_parseHex() doesn't actually accept w3c-defined color names #14

toolness opened this Issue Jan 20, 2012 · 2 comments


None yet
2 participants

Because the _colors hash is filled with CamelCased names and _parseHex() lowercases its input before looking it up in _colors, it never recognizes w3c-defined names. Consequently, w3c-defined names passed in via options.color and the setColor() method aren't recognized either.

In toolness/lovebomb.me@aff9a94 I've patched the code by creating a separate hash called _lowerColors and looking up lowercased input in that. Let me know if you think this is a decent solution and I'll make a unit test for it and submit it as a pull request.


vanderlee commented Jan 23, 2012

Thanks for the notice.
I've just made all color names lowercase instead, seeing as they are used only for reading.

vanderlee closed this Jan 23, 2012

Cool, thanks Martijn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment