Merge pull request #16 from To1ne/tc-rainbow-stalker-effect

Add Rainbow stalker effect
pull/365/head
Gergely Nagy 7 years ago committed by GitHub
commit b575a232be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -76,6 +76,10 @@ The plugin provides the following effects:
> A blazing trail of fire will follow our fingers! > A blazing trail of fire will follow our fingers!
### `Rainbow()`
> Leave a rainbow behind, where your fingers has been!
## Dependencies ## Dependencies
* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl) * [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl)

@ -127,6 +127,19 @@ cRGB BlazingTrail::compute(uint8_t *step) {
return color; return color;
} }
// Rainbow
Rainbow::Rainbow(void) {
}
cRGB Rainbow::compute(uint8_t *step) {
if (*step > 0)
*step -= 1;
else
*step = 0;
return hsvToRgb(255 - *step, 255, *step);
}
} }
} }

@ -67,6 +67,13 @@ class BlazingTrail : public StalkerEffect::ColorComputer {
cRGB compute(uint8_t *step) final; cRGB compute(uint8_t *step) final;
}; };
class Rainbow : public StalkerEffect::ColorComputer {
public:
Rainbow(void);
cRGB compute(uint8_t *step) final;
};
} }
} }

Loading…
Cancel
Save