bpostlethwaite / colormap

output rgb or hex colormaps
MIT License
223 stars 33 forks source link

YlOrRd & YlGnBu colormap typo? #32

Open afarme3 opened 1 year ago

afarme3 commented 1 year ago

Hello, I have been using this library for colormapping geospatial data in OpenLayers - with an option for the user to choose between any of the colormaps available.

In the reference image, there are colormaps 'YlOrRd' and 'YlGnBu' , which I had removed because using this string for retrieving a colormap had thrown an error that the colormap did not exist.

Looking at colorScale.js , it looks like these are actually stored as 'yiorrd' and 'yignbu' - is the 'l' actually supposed to be an 'i'? 'RdBu' is also capitalized in the image and lowercase in the code.

Either this is a typo on the implementation end, or a typo on the reference image. With no user reference other than the image for the names to use for colormaps, this had me confused.

Could you please either update the naming in the code or in the image? Thank you.

endolith commented 1 year ago

It should be YlOrRd, YlGnBu, etc. (Yl = "Yellow") See https://colorbrewer2.org/export/colorbrewer.css

nickyonge commented 12 months ago

Seconded. This is still an issue. Was getting wonky errors until I found this and changed my local reference from YlOrRd to YIOrRd, which works, but is obnoxious 😅