Effect Matrix * Better colors
This commit is contained in:
@ -127,6 +127,18 @@ void RandomMatrixEffectColumn::restart(bool completely_random) {
|
||||
_hue = random8();
|
||||
}
|
||||
|
||||
CRGB ColumnMatrixEffectColumn::_getColor(uint8_t i) {
|
||||
CRGB color;
|
||||
uint8_t dist = abs(length / 2 - i);
|
||||
color = CHSV(_hue, 255, 255 - dist * 5);
|
||||
return color;
|
||||
}
|
||||
|
||||
void ColumnMatrixEffectColumn::restart(bool completely_random) {
|
||||
MatrixEffectColumn::restart(completely_random);
|
||||
_hue = random8();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -174,6 +186,15 @@ void RainbowMatrixEffect::_create() {
|
||||
for (int i=0; i<_count; i++) _columns[i] = new RainbowMatrixEffectColumn(window, MatrixEffectColumn::DIR_SOUTH);
|
||||
}
|
||||
|
||||
ColumnMatrixEffect::ColumnMatrixEffect() {
|
||||
_init();
|
||||
_create();
|
||||
}
|
||||
|
||||
void ColumnMatrixEffect::_create() {
|
||||
for (int i=0; i<_count; i++) _columns[i] = new ColumnMatrixEffectColumn(window, MatrixEffectColumn::DIR_NORTH);
|
||||
}
|
||||
|
||||
MatrixEffectBase::~MatrixEffectBase() {
|
||||
_delete();
|
||||
}
|
||||
|
Reference in New Issue
Block a user