MCPcopy Create free account
hub / github.com/CopterExpress/clover / rainbow

Function rainbow

clover/src/led.cpp:50–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void rainbow(uint8_t n, uint8_t& r, uint8_t& g, uint8_t& b)
51{
52 if (n < 255 / 3) {
53 r = n * 3;
54 g = 255 - n * 3;
55 b = 0;
56 } else if (n < 255 / 3 * 2) {
57 n -= 255 / 3;
58 r = 255 - n * 3;
59 g = 0;
60 b = n * 3;
61 } else {
62 n -= 255 / 3 * 2;
63 r = 0;
64 g = n * 3;
65 b = 255 - n * 3;
66 }
67}
68
69void fill(uint8_t r, uint8_t g, uint8_t b)
70{

Callers 1

proceedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected