FastLED 3.9.15
|
|
inline |
Adjusts the color in the smallest way possible so that the parity of the coloris now the desired value.
This allows you to "hide" one bit of information in the color.
Ideally, we find one color channel which already has data in it, and modify just that channel by one. We don't want to light up a channel that's black if we can avoid it, and if the pixel is 'grayscale', (meaning that R==G==B), we modify all three channels at once, to preserve the neutral hue.
There's no such thing as a free lunch; in many cases this "hidden bit" may actually be visible, but this code makes reasonable efforts to hide it as much as is reasonably possible.
Also, an effort is made to make it such that repeatedly setting the parity to different values will not cause the color to "drift". Toggling the parity twice should generally result in the original color again.
Definition at line 442 of file crgb.h.
References FASTLED_FORCE_INLINE, and getParity().