First pixel of MatrixEffect is enforced to be white.

This commit is contained in:
Fabian Schlenz 2019-06-04 06:51:36 +02:00
parent ac2de19d7a
commit 788b1f4119
2 changed files with 6 additions and 2 deletions

View File

@ -8,5 +8,5 @@ __attribute__ ((aligned(4))) extern const TProgmemRGBGradientPalette_byte palett
__attribute__ ((aligned(4))) extern const TProgmemRGBGradientPalette_byte palette_matrix[] FL_PROGMEM = { __attribute__ ((aligned(4))) extern const TProgmemRGBGradientPalette_byte palette_matrix[] FL_PROGMEM = {
0, 0, 0, 0, // black 0, 0, 0, 0, // black
200, 0,255, 0, // green 240, 0,255, 0, // green
255, 255,255,255 }; // white 255, 255,255,255 }; // white

View File

@ -26,7 +26,11 @@ void MatrixEffectColumn::advance() {
void MatrixEffectColumn::draw() { void MatrixEffectColumn::draw() {
for(int i=0; i<length; i++) { for(int i=0; i<length; i++) {
setPixel(*window, x, y-i, ColorFromPalette((CRGBPalette16)palette_matrix, 255 * (length - i) / length)); if (i==0) {
setPixel(*window, x, y-i, CRGB(255, 255, 255));
} else {
setPixel(*window, x, y-i, ColorFromPalette((CRGBPalette16)palette_matrix, 255 * (length - i) / length));
}
} }
} }