1818
1919#define MAX_DOTS 192
2020
21+ CRGBF WHITE_BALANCE = { 1.0 , 0.75 , 0.60 };
22+
2123typedef enum {
2224 UI_1 , UI_2 , UI_3 , UI_4 , UI_5 , UI_6 , UI_7 , UI_8 , UI_9 , UI_10 ,
2325 UI_NEEDLE ,
@@ -41,7 +43,7 @@ CRGBF leds_smooth[NUM_LEDS];
4143
4244float rendered_debug_value = 0.0 ;
4345
44- CRGBF incandescent_lookup = {1.0000 , 0.4453 , 0.1562 };
46+ CRGBF incandescent_lookup = {1.0000 * 1.0000 , 0.4453 * 0.4453 , 0.1562 * 0.1562 };
4547
4648float note_colors [12 ] = {0.0000 , 0.0833 , 0.1666 , 0.2499 , 0.3333 , 0.4166 ,
4749 0.4999 , 0.5833 , 0.6666 , 0.7499 , 0.8333 , 0.9166 };
@@ -471,36 +473,36 @@ void apply_brightness() {
471473 scale_CRGBF_array_by_constant (leds , brightness_val * brightness_val , NUM_LEDS );
472474}
473475
474- void apply_base_coat (){
475- if (configuration .base_coat > 0.01 ){
476- float base_coat_level = configuration .base_coat * 0.20 ; // Max 20% brightness
476+ void apply_background (){
477+ if (configuration .background > 0.01 ){
478+ float background_level = configuration .background * 0.20 ; // Max 20% brightness
477479
478480 if (configuration .mirror_mode == false){
479- float base_coat_inv = (1.0 - base_coat_level );
481+ float background_inv = (1.0 - background_level );
480482 for (uint16_t i = 0 ; i < NUM_LEDS ; i ++ ){
481483 float progress = float (i ) / NUM_LEDS ;
482- CRGBF base_coat_color = hsv (configuration .hue + (configuration .hue_range * progress ), configuration .saturation , base_coat_level * base_coat_level );
483- leds [i ].r = leds [i ].r * base_coat_inv + base_coat_color .r ;
484- leds [i ].g = leds [i ].g * base_coat_inv + base_coat_color .g ;
485- leds [i ].b = leds [i ].b * base_coat_inv + base_coat_color .b ;
484+ CRGBF background_color = hsv (configuration .hue + (configuration .hue_range * progress ), configuration .saturation , background_level * background_level );
485+ leds [i ].r = leds [i ].r * background_inv + background_color .r ;
486+ leds [i ].g = leds [i ].g * background_inv + background_color .g ;
487+ leds [i ].b = leds [i ].b * background_inv + background_color .b ;
486488 }
487489 }
488490 else {
489- float base_coat_inv = (1.0 - base_coat_level );
491+ float background_inv = (1.0 - background_level );
490492 for (uint16_t i = 0 ; i < (NUM_LEDS >> 1 ); i ++ ){
491493 float progress = float (i ) / (NUM_LEDS >>1 );
492- CRGBF base_coat_color = hsv (configuration .hue + (configuration .hue_range * progress ), configuration .saturation , base_coat_level * base_coat_level );
494+ CRGBF background_color = hsv (configuration .hue + (configuration .hue_range * progress ), configuration .saturation , background_level * background_level );
493495
494496 int16_t left_index = 63 - i ;
495497 int16_t right_index = 64 + i ;
496498
497- leds [left_index ].r = leds [left_index ].r * base_coat_inv + base_coat_color .r ;
498- leds [left_index ].g = leds [left_index ].g * base_coat_inv + base_coat_color .g ;
499- leds [left_index ].b = leds [left_index ].b * base_coat_inv + base_coat_color .b ;
499+ leds [left_index ].r = leds [left_index ].r * background_inv + background_color .r ;
500+ leds [left_index ].g = leds [left_index ].g * background_inv + background_color .g ;
501+ leds [left_index ].b = leds [left_index ].b * background_inv + background_color .b ;
500502
501- leds [right_index ].r = leds [right_index ].r * base_coat_inv + base_coat_color .r ;
502- leds [right_index ].g = leds [right_index ].g * base_coat_inv + base_coat_color .g ;
503- leds [right_index ].b = leds [right_index ].b * base_coat_inv + base_coat_color .b ;
503+ leds [right_index ].r = leds [right_index ].r * background_inv + background_color .r ;
504+ leds [right_index ].g = leds [right_index ].g * background_inv + background_color .g ;
505+ leds [right_index ].b = leds [right_index ].b * background_inv + background_color .b ;
504506 }
505507 }
506508 }
0 commit comments