diff options
author | Ryan <[email protected]> | 2024-10-13 05:00:56 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-12 19:00:56 +0100 |
commit | 9884e4982be942a98cf5bca9360d20cc3fca3e9d (patch) | |
tree | 2ec0af3864f1839a8896b25090f8fa7024394fdc /keyboards/wilba_tech | |
parent | 5478051d7470efb32783b1c4080a2c3f24ce3c24 (diff) | |
download | qmk_firmware-9884e4982be942a98cf5bca9360d20cc3fca3e9d.tar.gz qmk_firmware-9884e4982be942a98cf5bca9360d20cc3fca3e9d.zip |
Rename RGB/HSV structs: keyboard-level code (#24476)
Diffstat (limited to 'keyboards/wilba_tech')
-rw-r--r-- | keyboards/wilba_tech/wt_mono_backlight.c | 4 | ||||
-rw-r--r-- | keyboards/wilba_tech/wt_rgb_backlight.c | 48 |
2 files changed, 26 insertions, 26 deletions
diff --git a/keyboards/wilba_tech/wt_mono_backlight.c b/keyboards/wilba_tech/wt_mono_backlight.c index 1426e09fc6..01fefc8ecc 100644 --- a/keyboards/wilba_tech/wt_mono_backlight.c +++ b/keyboards/wilba_tech/wt_mono_backlight.c @@ -150,8 +150,8 @@ void backlight_effect_cycle_all(void) void backlight_effect_indicators(void) { #if defined(MONO_BACKLIGHT_WT75_A) - HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; - RGB rgb = hsv_to_rgb( hsv ); + hsv_t hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; + rgb_t rgb = hsv_to_rgb( hsv ); // SW7,CS8 = (6*8+7) = 55 // SW8,CS8 = (7*8+7) = 63 // SW9,CS8 = (8*8+7) = 71 diff --git a/keyboards/wilba_tech/wt_rgb_backlight.c b/keyboards/wilba_tech/wt_rgb_backlight.c index 645ee2b32a..e52d002060 100644 --- a/keyboards/wilba_tech/wt_rgb_backlight.c +++ b/keyboards/wilba_tech/wt_rgb_backlight.c @@ -1258,16 +1258,16 @@ void backlight_effect_all_off(void) // Solid color void backlight_effect_solid_color(void) { - HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; - RGB rgb = hsv_to_rgb( hsv ); + hsv_t hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; + rgb_t rgb = hsv_to_rgb( hsv ); backlight_set_color_all( rgb.r, rgb.g, rgb.b ); } // alphas = color1, mods = color2 void backlight_effect_alphas_mods(void) { - RGB rgb1 = hsv_to_rgb( (HSV){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } ); - RGB rgb2 = hsv_to_rgb( (HSV){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } ); + rgb_t rgb1 = hsv_to_rgb( (hsv_t){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } ); + rgb_t rgb2 = hsv_to_rgb( (hsv_t){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } ); bool is_alpha = false; for ( int row = 0; row < MATRIX_ROWS; row++ ) { @@ -1352,8 +1352,8 @@ void backlight_effect_gradient_up_down(void) int16_t s2 = g_config.color_2.s; int16_t deltaS = ( s2 - s1 ) / 4; - HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; - RGB rgb; + hsv_t hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + rgb_t rgb; Point point; for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) { @@ -1390,8 +1390,8 @@ void backlight_effect_raindrops(bool initialize) int16_t s2 = g_config.color_2.s; int16_t deltaS = ( s2 - s1 ) / 4; - HSV hsv; - RGB rgb; + hsv_t hsv; + rgb_t rgb; // Change one LED every tick uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % BACKLIGHT_LED_COUNT : 255; @@ -1431,8 +1431,8 @@ void backlight_effect_cycle_all(void) #endif offset2 = (offset2<=63) ? (63-offset2) : 0; - HSV hsv = { .h = offset+offset2, .s = 255, .v = g_config.brightness }; - RGB rgb = hsv_to_rgb( hsv ); + hsv_t hsv = { .h = offset+offset2, .s = 255, .v = g_config.brightness }; + rgb_t rgb = hsv_to_rgb( hsv ); backlight_set_color( i, rgb.r, rgb.g, rgb.b ); } } @@ -1440,8 +1440,8 @@ void backlight_effect_cycle_all(void) void backlight_effect_cycle_left_right(void) { uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; - RGB rgb; + hsv_t hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + rgb_t rgb; Point point; for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) { @@ -1467,8 +1467,8 @@ void backlight_effect_cycle_left_right(void) void backlight_effect_cycle_up_down(void) { uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; - RGB rgb; + hsv_t hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + rgb_t rgb; Point point; for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) { @@ -1493,8 +1493,8 @@ void backlight_effect_cycle_up_down(void) void backlight_effect_jellybean_raindrops( bool initialize ) { - HSV hsv; - RGB rgb; + hsv_t hsv; + rgb_t rgb; // Change one LED every tick uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % BACKLIGHT_LED_COUNT : 255; @@ -1519,8 +1519,8 @@ void backlight_effect_jellybean_raindrops( bool initialize ) void backlight_effect_cycle_radial1(void) { uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; - RGB rgb; + hsv_t hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + rgb_t rgb; Point point; for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) { @@ -1537,8 +1537,8 @@ void backlight_effect_cycle_radial2(void) { uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; - HSV hsv = { .h = 0, .s = g_config.color_1.s, .v = g_config.brightness }; - RGB rgb; + hsv_t hsv = { .h = 0, .s = g_config.color_1.s, .v = g_config.brightness }; + rgb_t rgb; Point point; for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) { @@ -1559,10 +1559,10 @@ void backlight_effect_cycle_radial2(void) #if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C) void backlight_effect_custom_colors(void) { - RGB rgb; + rgb_t rgb; for ( uint8_t i = 0; i < RGB_BACKLIGHT_CUSTOM_COLORS_COUNT; i++ ) { - HSV hsv = { .h = g_config.custom_color[i].h, .s = g_config.custom_color[i].s, .v = g_config.brightness }; + hsv_t hsv = { .h = g_config.custom_color[i].h, .s = g_config.custom_color[i].s, .v = g_config.brightness }; rgb = hsv_to_rgb( hsv ); uint8_t led; map_row_column_to_led( 0, i, &led ); @@ -1580,8 +1580,8 @@ void backlight_effect_custom_colors(void) void backlight_effect_indicators_set_colors( uint8_t index, HS color ) { - HSV hsv = { .h = color.h, .s = color.s, .v = g_config.brightness }; - RGB rgb = hsv_to_rgb( hsv ); + hsv_t hsv = { .h = color.h, .s = color.s, .v = g_config.brightness }; + rgb_t rgb = hsv_to_rgb( hsv ); if ( index == 254 ) { backlight_set_color_all( rgb.r, rgb.g, rgb.b ); |