Computer color is broken:  https://www.youtube.com/watch?v=LKnqECcg6Gw Interesting minute physics video on color blending.

Computer color is broken: https://www.youtube.com/watch?v=LKnqECcg6Gw Interesting minute physics video on color blending.
Here a javascript canvas implementation from Mario Klingemann: http://codepen.io/quasimondo/pen/VLaYjx

Would this sqrt calculation be possible for FastLED (ARM). Or are the benefits too small (since hue blending is nicer anyway?).

Thanks for posting this. It made the rounds a little while ago, and as you might imagine, I jumped on it: I already have this kind of sqrt-based blending coded and running “in the lab” (vs “in the lib”). It’s in the queue to get cleaned up and released; part of the change a few months ago from the “NOBLEND / BLEND” flag for color palettes to “NOBLEND / LINEARBLEND” was to allow for the eventual “NOBLEND / LINEARBLEND / QUADRATICBLEND” option.

The quality of blending is noticeable in cases where you’re doing an RGB blend between colors with very different RGB distribution, e.g. from blue to yellow. If you define a FastLED color palette with adjacent entries that are very different from each other, the blending type you use does make a visual difference.

TRY THIS> To experiment yourself, read “Computer Color is Only Kinda Broken” http://scottsievert.github.io/blog/2015/04/23/image-sqrt/ and check out the test gadget at the bottom.

The high quality blend does use square root, which is slower than linear blending (which just uses multiplication). On ARM platforms it uses native Arduino sqrt(), but on AVR platforms it uses FastLED’s “sqrt16” which is substantially faster on those platforms. QUADRATICBLEND won’t be the default, but we’ll definitely make it available in the library at some point. (Our backlog is getting a bit ponderous at the moment, but we’re grinding away on it.)

Anyway, YES! And thanks for posting this here!

PS. Secret hint of things to come: FastLED 3.1 currently ships with six pre-defined color palettes. If there were a couple more, the high-quality palette blending would be more valuable now wouldn’t it?

@Mark_Kriegsman Indeed, more. . Let’s see, I’d like wavy fish tank blue, royal purple, and am always up for whatever comes our way.

Thanks @Mark_Kriegsman for your comment. I came across that movie earlier as well but I forgot to post it. Nice to hear that you already made an implementation. That github gadget visualises the problem nicely indeed.

Why do you want pre-built palettes in the library when it’s so easy to roll your own? o_O

I definitely would appreciate QUADRATICBLEND, however!