|
|
|
@ -245,17 +245,35 @@ void LEDControl_::hsv_to_rgb(cRGB *cRGB, uint16_t h, uint16_t s, uint16_t v) {
|
|
|
|
|
/* assign temp vars based on color cone region */
|
|
|
|
|
switch(region) {
|
|
|
|
|
case 0:
|
|
|
|
|
cRGB->r = v; cRGB->g = t; cRGB->b = p; break;
|
|
|
|
|
cRGB->r = v;
|
|
|
|
|
cRGB->g = t;
|
|
|
|
|
cRGB->b = p;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
cRGB->r = q; cRGB->g = v; cRGB->b = p; break;
|
|
|
|
|
cRGB->r = q;
|
|
|
|
|
cRGB->g = v;
|
|
|
|
|
cRGB->b = p;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
cRGB->r = p; cRGB->g = v; cRGB->b = t; break;
|
|
|
|
|
cRGB->r = p;
|
|
|
|
|
cRGB->g = v;
|
|
|
|
|
cRGB->b = t;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
cRGB->r = p; cRGB->g = q; cRGB->b = v; break;
|
|
|
|
|
cRGB->r = p;
|
|
|
|
|
cRGB->g = q;
|
|
|
|
|
cRGB->b = v;
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
cRGB->r = t; cRGB->g = p; cRGB->b = v; break;
|
|
|
|
|
cRGB->r = t;
|
|
|
|
|
cRGB->g = p;
|
|
|
|
|
cRGB->b = v;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
cRGB->r = v; cRGB->g = p; cRGB->b = q; break;
|
|
|
|
|
cRGB->r = v;
|
|
|
|
|
cRGB->g = p;
|
|
|
|
|
cRGB->b = q;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|