Fork me on GitHub
#quil
<
2022-06-21
>
Eric03:06:08

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

genmeblog06:06:49

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

genmeblog06:06:21

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

genmeblog07:06:24

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).

Eric17:06:41

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.

genmeblog17:06:46

Gradients are best in Oklab. You can find more about gradients here https://clojure2d.github.io/clojure2d/docs/notebooks/index.html#/notebooks/color.clj

genmeblog18:06:06

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

genmeblog18:06:55

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

🙏 1
Eric18:06:34

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.

genmeblog18:06:07

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.

genmeblog18:06:35

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

Eric18:06:07

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