Remove our internal SetHSV implementation

pull/18/head
Jesse Vincent 9 years ago
parent 27cb42eade
commit 013175e333

@ -215,61 +215,5 @@ void LEDControl_::type_letter(uint8_t letter) {
} }
/* SetHSV from light_ws2812. Their source was:
* getRGB() function based on <http://www.codeproject.com/miscctrl/CPicker.asp>
* dim_curve idea by Jims
* */
void LEDControl_::SetHSV(cRGB *crgb, int hue, byte sat, byte val) {
/* convert hue, saturation and brightness ( HSB/HSV ) to RGB
*/
int base;
if (sat == 0) { // Acromatic color (gray). Hue doesn't mind.
crgb->r = val;
crgb->g = val;
crgb->b = val;
} else {
base = ((255 - sat) * val) >> 8;
switch (hue / 60) {
case 0:
crgb->r = val;
crgb->g = (((val - base)*hue) / 60) + base;
crgb->b = base;
break;
case 1:
crgb->r = (((val - base)*(60 - (hue % 60))) / 60) + base;
crgb->g = val;
crgb->b = base;
break;
case 2:
crgb->r = base;
crgb->g = val;
crgb->b = (((val - base)*(hue % 60)) / 60) + base;
break;
case 3:
crgb->r = base;
crgb->g = (((val - base)*(60 - (hue % 60))) / 60) + base;
crgb->b = val;
break;
case 4:
crgb->r = (((val - base)*(hue % 60)) / 60) + base;
crgb->g = base;
crgb->b = val;
break;
case 5:
crgb->r = val;
crgb->g = base;
crgb->b = (((val - base)*(60 - (hue % 60))) / 60) + base;
break;
}
}
}
LEDControl_ LEDControl; LEDControl_ LEDControl;

@ -78,7 +78,6 @@ class LEDControl_ {
void effect_heatmap_update(); void effect_heatmap_update();
void effect_numlock_update(); void effect_numlock_update();
void set_all_leds_to(cRGB color); void set_all_leds_to(cRGB color);
void SetHSV(cRGB *crgb, int hue, byte sat, byte val);
void initialize_led_mode(uint8_t mode); void initialize_led_mode(uint8_t mode);
}; };

Loading…
Cancel
Save