Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
GradientPalette behaving unexpected #515
I tried using a Gradient Palette and get strange results. I'm not sure if im using it incorrectly or if there's a bug inside the Library. (I'm using a NodeMCU v1/ ESP8266)
Following this wiki page I'm doing the following steps:
In my understanding the led should turn on and be pure white with a Brightness of 255. But in reality I get a dim greenish color.
The issue goes away if I use CRGBPalette256 in step 2 instead of CRGBPalette16.
Am I doing something wrong or is this a bug ?
In order to support smooth blending for "circular" palettes, each color blends with "the next", and in the case of the last color, "the next" is the first color since it wraps around, so the last 15 numbers are blending back toward index 0. Sometime circular blending is very useful, other times it might not be what you want. You can use index 240 as your last value to avoid blending.
If you would still like to code using a 0-255 range but have the output maximum be 240 and avoid wrapping you can use the scale8 function: