Fork me on GitHub

Does anyone know if it’s possible to get HCL color in Quil?


RGB color defined in quil will work in Clojure2d without any conversion.


To convert from Clojure2d to Quil call clojure2d.color/quil


HCL defined in Clojure2d is based on Sarifuddin/Missaou method with λ=3. If you want a converter based on CIELab color space use LCH. There are also other like: JCH (based on JzAzBz) and Oklch (based on Oklab).


That looks great, thank you! I suppose I can get most of the benefits of HCL by creating my gradients in HCL with Clojure2D, then converting back to the HSB space I’m using for most things in Quil.


Gradients are best in Oklab. You can find more about gradients here


And yeah, it's easy to make such interop. I can help you with this if you wish.


Generally hue based color spaces are not good for gradients, because they force traversing through many hue values.

🙏 1

Ahh, interesting. Yeah, I knew HSB worked better than RGB for that. Then I read about HCL preserving luminance across the hues, but Oklab is unknown to me so far.


Generally all linear luma based color spaces like lab, luv, oklab, jab, etc. are good when you want to keep brightness under control. All above also nicely blend hues.


Hue based just can introduce unwanted colors giving a rainbow effect. However, for generative art it can be very beneficial :)


I sometimes like the results of those hue rainbows, but there are definitely times when I want a gradient directly between two colors that are not adjacent in hue. I should certainly add a lab scheme to my toolbox. Thanks for the advice. :)

👍 1