MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / fadeColor

Function fadeColor

src/Functions.cpp:252–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252uint32_t fadeColor(uint32_t color, uint32_t interval)
253{
254 float phase = (sin(2 * PI * millis() / float(interval)) + 1) * 0.5;
255 uint8_t r = ((color >> 16) & 0xFF) * phase;
256 uint8_t g = ((color >> 8) & 0xFF) * phase;
257 uint8_t b = (color & 0xFF) * phase;
258 return (r << 16) | (g << 8) | b;
259}
260
261uint32_t TextEffect(uint32_t color, uint32_t fade, uint32_t blink)
262{

Callers 2

StatusOverlayFunction · 0.85
drawIndicatorsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected