Changed MatrixEffect to use color palettes.
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
#include "effect_matrix.h"
|
||||
#include "my_color_palettes.h"
|
||||
#include "functions.h"
|
||||
|
||||
MatrixEffectColumn::MatrixEffectColumn() { }
|
||||
MatrixEffectColumn::MatrixEffectColumn() {
|
||||
}
|
||||
|
||||
MatrixEffectColumn::MatrixEffectColumn(Window* win, int xPos) {
|
||||
MatrixEffectColumn::MatrixEffectColumn(Window* win, int xPos) : MatrixEffectColumn() {
|
||||
window = win;
|
||||
x = xPos;
|
||||
start();
|
||||
@ -24,11 +26,7 @@ void MatrixEffectColumn::advance() {
|
||||
|
||||
void MatrixEffectColumn::draw() {
|
||||
for(int i=0; i<length; i++) {
|
||||
CRGB color;
|
||||
if (i==0) color=CHSV(85, 0, 192);
|
||||
else color=CHSV(85, 255, 255/(length-1)*(length-i));
|
||||
|
||||
setPixel(*window, x, y-i, color);
|
||||
setPixel(*window, x, y-i, ColorFromPalette((CRGBPalette16)palette_matrix, 255 * (length - i) / length));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user