I’ve read the FadeCandy code, and you’re right that it’s being used for something different there. (We’ve had some interesting discussions about it with Micah, the creator of FadeCandy, too.)
I’ll reread the FC code again, and post a summary comparison because it’s interesting.
Both FC and FastLED take 8 bits of input for each pixel channel value. FC stretches it out so that the low end of the 8-bit range is ‘lower’ while still preserving dynamic range within it. In effect, it’s using 8-bit input as an index into a 16-bit lookup table (LUT), and then (trying to) use the 16 bit value as the LED brightness.
I say ‘trying to’ not to disparage the FC code (at all!), but rather because at the 400Hz update rate that FC uses, only 11 bits are useful. FastLED has a variable update rate (it’s up to you how often you call show() ), but I think we have broadly similar limits. FastLED has 8 bits of data per pixel, plus 8 bits of master brightness, but I think it’s nearly impossible to get more than 12 useful bits out of it, and calling it 10 or 11 is probably more correct.
Given your previous comments and code with respect to gamma correction curves, let me think about this for a bit. ‘Long tail’ gamma correction is what your thinking about here, right?
Really what we’d want in an ideal world is 16-bit-per-channel pixel values (CRGB16). On a 48-, 72-, or 96- MHz ARM-based MCU, we can do useful stuff there – and we do plan to incorporate that into FastLED.
But on an 8- or 16- MHz AVR MCU we are literally out of clock cycles already doing what we’re doing now with FastLED v2.1: brightness control, color corrections, AND dithering, all still at maximum ‘wire speed’, and without requiring any addition SRAM usage.
Let me think about this all a bit. We are ‘out of clock cycles’ on AVR, but maybe this discussion can help us think about the fully-16-bit future on ARM.