Hacker News new | past | comments | ask | show | jobs | submit login

HSV is just a straight-forward transformation of RGB https://en.wikipedia.org/wiki/File:Hsl-and-hsv.svg

The set of “all colors” is exactly the same.

(Note, HSL/HSV are not suitable representations for almost any purpose, especially not for human user interfaces; it’s a tragedy that they are in such wide use.)




A color space is good for transforming colors along lines orthogonal to its axes. In RGB, you can't easily find another shade of a given hue. In HSV, this common task is trivial.


I was going to comment that HSL/HSV can be useful for generating colors that work well, but... the real problem is not luminance as much as the HSL values we commonly use. See http://en.wikipedia.org/wiki/HSL_and_HSV#Disadvantages where CIELAB L* is shown as a better representation. Though it's not perfectly matched to the human eye even so.



Whjy do you say that? I find them much more intuitive. For example, getting actually brown browns with RGB is tricky...with HSV it's trivial.


A rule of thumb if you have to find brown in RGB: use a bit of red, slightly less green, then a tiny bit of blue.


That kind of proves the point. How many of those rules of thumb are you going to have to formulate to express in RGB what's trivial to find in HSV?


Unfortunately I've already formulated them after working so much with RGB in low-level graphics code, pre-hsv() CSS, and some image editing software.

Actually, that sounds kind of like a fun challenge game: name a color, then try to guess RGB values for that color.


I've gotten pretty good at doing the reverse operation(given an RGB value, guess the color) because I'm red-green colorblind and that's how I figure out what color something is :)


The converse game exists: http://yizzle.com/whatthehex/

Edit: Actually, so does the “guess the RGB given the colour” direction, but I don’t find it as fun: http://mallory.jemts.com


jacobulus might have been referring to certain color spaces that are optimized for human use instead of for computer manipulation, such as HUSL (http://www.boronine.com/husl/). HUSL gives you a slider that actually changes the apparent brightness of a color to your eye: whereas HSL thinks that bright green is just as “light” as dark true blue, and HSV/HSB thinks that true blue is just as “bright” as white, HUSL colors with the same “lightness” actually do look equally light. Another human-optimized color space is CIELUV (https://en.wikipedia.org/wiki/CIELUV).


The mapping is not one-to-one though - for example when S is 0, all values of H give the same resulting colour, and worse when V is zero both H and S are useless. So an image exploring the full HSV space should look different, probably with a lot more of the grayscale.

I too have misgivings about HSV, the discontinuities created when generating hue ramps being particularly cruel. Using a rotation about the luma axis in YCbCr space gives much smoother rainbows but sadly not ones which hit all six primaries and secondaries. It's frustrating problem that perceptually H, S and V or L are what we think of when specifying a colour, but mapping them smoothly to RGB displays is so tough.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: