| 339 | } |
| 340 | |
| 341 | uint32_t MatrixDisplayUi::fadeColor(uint32_t color, uint32_t interval) |
| 342 | { |
| 343 | float phase = (sin(2 * PI * millis() / float(interval)) + 1) * 0.5; |
| 344 | uint8_t r = ((color >> 16) & 0xFF) * phase; |
| 345 | uint8_t g = ((color >> 8) & 0xFF) * phase; |
| 346 | uint8_t b = (color & 0xFF) * phase; |
| 347 | return (r << 16) | (g << 8) | b; |
| 348 | } |
| 349 | |
| 350 | uint8_t currentTransition; |
| 351 | bool gotNewTransition = true; |
nothing calls this directly
no outgoing calls
no test coverage detected