HCG, OKHCG, & "color-blind" color-spaces #576
Replies: 2 comments 6 replies
-
There is a lot of stuff here, so I'm not exactly sure what is being asked.
|
Beta Was this translation helpful? Give feedback.
-
no questions, just ideas.... |
Beta Was this translation helpful? Give feedback.
-
Aloha again!
Thank y'all so much for developing this project. Y'all are really paving the way forward with digitally described color. It has been my go-to source for developing my own project. My project is over 10 year old, and a complete overhaul to use the Color.js class was not is store. But your "flagship model" of the "Swiss-Army-Knife" of color-libraries certainly is impressive.
Years ago I "discovered" what I call the HCG (Hue, Chroma∝, Gray) color-space. It is mapped to the an RGB color-space, and is a simple interpolation of a "fully chromatic hue" (same as fully saturated color, with full brightness (a.k.a. value) in HSB/HSV, where one RGB channel is 100%, another is 0%, and the third varies) with a "grayscale tone" (where all RGB channels are equal). It is a super-simple, super-fast, easy-to-calculate conversion to-from RGB.
Chroma∝ here differs a bit from Chroma in LCh and similar color spaces, in that its mathematical percentage value is relative to the maximum Chroma for any given hue in the RGB color-space it is mapped to, i.e. "digital" or "mathematical" chroma, as opposed to "perceived" chroma. So HCG(120deg, 100%, 50%) (CSS: lime) is more vibrant (has more "perceived" Chroma) than HCG(240deg, 100%, 50%) (CSS: blue).
I chose this term "Chroma" based on what Wikipedia taught me about color-spaces, back in circa 2011 or 2012. Somewhere it mentioned the term, but I didn't yet know about "exotic" color-spaces like Hunter Lab or CIE L*a*b*, or the Munsell Color System. I was really still trying to understand HSL & HSV, and I wanted a term that differentiated HCG from them. From what I remember Wikipedia telling me back then, HSL & HSV are based on "real-life" observations (i.e. "value" or "brightness" is the brightness of a light (D65?) shining on a white paper with a "water-color" painted on - how watery ? - that's saturation). Chroma∝ is purely in the digital realm of computer displays. And "Gray" was chosen for the same reason.
Chroma∝ is primary, unlike saturation, value (brightness), or lightness. At 100% Chroma∝, Gray does not matter. At 0%, the Hue does not matter. I have found over the years it is this property that makes it so very useful, digitally, mathematically, AND intuitively,
I "discovered" this color-space by trying to find a mathematical algorithm to map the "websafe colors" (yea, back in the day...). I needed a color-picker for my website app, and MSIE6 was still king back then, but MSIE9 was out and supported the canvas API. After "discovering" this algorithm, I realized it to be a legit color-space. From that came the RainbowMaestro color-picker, a legitimately different, yet familiar graphical color-picker, that's not just "weird" like some other "different" color-pickers I've seen out there through time.
I realized that this color-space, HCG, was (must be!) very old, as (as memory serves) Wikipedia showed me a picture of "one of the original computerized color-pickers" with the rainbow-ring and the triangle in the middle; the triangle has one tip fully-chromatic∝, one tip is black, and one tip is white, with a gradient from each tip to the others and throughout the middle. Just no one had "published" it. I've seen that color-picker described multiple times as being an implementation of HSV, HSL, or HWB, but none are correct: those values must be converted or otherwise manipulated to map them to a triangle. HCG is that conversion mapping.
From there, my color-picker app evolved, expanded, etc. I've found HCG to be the go-to color-space for many different needs:
But as an end-user myself, I find it to be the go-to color-space in the "Color-Space Lab" where I can manipulate a color using sliders in many different color-spaces at once.
"I want more or less color"
or
"I want it darker or lighter"
Except for fully-chromatic colors and grayscale tones, HSL and HSV require you manipulate 2 sliders, not one.
Then along came the so-called "OK" color-spaces. Much better hue-mapping in less-chromatic colors. So very useful! Only to incorporate it into my color-picker project..... But I needed that HCG mapping to map the "OK" colors to the color-picker's "triangle"..... So from OKHSV was born OKHCG.
Really, if I didn't think these color-spaces were so useful, I wouldn't bother y'all with them. But I do. If you do, maybe you should incorporate them into Color.js ???
And how about color-blind support? What is picking a color without color-blind support? A guess.
Maybe you should incorporate that conversion tool into the Swiss-army-knife y'all got.
You can find the code for HCG and OKHCG in my RGB_Calc repo.
You can find the code for the "Rigden color-blind websafe table interpolator" in its own repo. I''m not color-blind and don't knowingly know anyone who is, but it seems to me this color-blind converter works better than the Wickline one below....especially in the "yellow" hues. That's not me, that's Rigden's colorblind table, based on real-life trials, not a mathematical approximation.
I also adapted "scratchdot's" port of the Wickline colorblind conversion algorithm in its own repo, but check the originals.
And you can find all this put together in one project that demonstrates it all: the MasterColorPicker. I didn't originally set out to create a "Master" of color-pickers. It just ended up that way. Now I'm stuck trying to keep it up to date so it continues to live up to its name !!!! (I just want to move on to other pending projects, but you meddling kids ☺☻ keep forcing me to expand it ... BTW, what the hell is Jzazbz ... back to school...and more updates...)
https://github.com/SoftMoonWebWare/RGB_Calc-color-space-converter
https://github.com/SoftMoonWebWare/Rigden-color-blind-websafe-interpolator
https://github.com/SoftMoonWebWare/skratchdot.Wickline.colorblind_converter
https://github.com/skratchdot/color-blind
http://colorlab.wickline.org/colorblind/colorlab/engine.js
https://github.com/SoftMoonWebWare/MasterColorPicker
Beta Was this translation helpful? Give feedback.
All reactions