Esri / storymap-shortlist

The Shortlist story map application template by Esri
http://storymaps.arcgis.com/en/app-list/shortlist/
Apache License 2.0
43 stars 61 forks source link

Icons are Gray When Custom Tab Colors Share any RGB Component with Standard Gray Icon #75

Open nheick opened 7 years ago

nheick commented 7 years ago

When modifying the colors of the tabs in the web app JSON, if the color has any RGB component that matches the color of the standard gray icon, typically (211, 211, 211), it will not display the icons with the custom color, but will leave them the standard color.

Looking at the code, this appears to be faulty logic in the following line in MainView.buildLayer. There is also an incorrect index in the last iconColor[1].

if(iconColor[0] !=hexToRgb(newIconColor).r && iconColor[1] != hexToRgb(newIconColor).g && iconColor[1] != hexToRgb(newIconColor).b)

The code should read:

if (!(iconColor[0] ==hexToRgb(newIconColor).r && iconColor[1] == hexToRgb(newIconColor).g && iconColor[2] == hexToRgb(newIconColor).b))

I tested this change and it works.