I am trying to figure out how to get chromaticity from HSV (alternative RGB). The problem is as follows; I hardly know what color is. According to the little information available on the net, it is usually called βrelative colorβ, which is a combination of hue and saturation.
From http://www.huevaluechroma.com/012.php :
Another term for the concept of color relative to the estimated maximum is chromaticity from the Swedish NCS system.
I have RGB, which I converted to HSV in PHP. I hope that there is someone who can provide their experience in this matter, because there seems to be very limited information. I need it to verify NCS codes.
Chromaticity calculation so far:
//$hsv is array(h, s, v), maximum considered to be 10000 $chroma = $hsv[1] * $hsv[2]; $chromaticness = $chroma / 10000;
For example, the color S 2065-B (# 0073B0) gives me a chromaticity of 69%, using the calculation above, when it should be 65%. Also, color S 0580-Y (# FECB00) gives me 99% when should it be 80%?
HSV in these examples that I get:
# 0073B0 {'H' => 200.79545454545, 'S' => 100, 'V' => 69.019607843137}
# FECB00 {'H' => 47.952755905512, 'S' => 100, 'V' => 99.607843137255}
This solution is welcomed in any programming language, however I am encoding PHP, so it will probably be converted to this.
javascript c # php colors
Undrium
source share