jfairbank / chroma

Ruby gem for color manipulation and palette generation
ISC License
232 stars 29 forks source link

Init with hsv formant bug #22

Open bulat-f opened 8 years ago

bulat-f commented 8 years ago

For example:

"hsv(100, 75%, 50%)".paint.to_hex # got: "#408020" expected: "#3F7F1F"

In fact #3F7F1F is hsv(100, 75%, 50.2%). Rounding error.

jfairbank commented 8 years ago

Hi @fatbulat. Life has been very busy for me the past several months, so I've unfortunately had to neglect this repo for a bit :/

Can you confirm where you're getting #3F7F1F from? I've tried three different online HSV converters (like http://colorizer.org/) and they all give me #408020 like Chroma. If you do find an input producing bad output, please let me know. My math could be off in the code, but in this case it looks correct.