diff options
| author | Ryan <fauxpark@gmail.com> | 2024-10-13 05:00:56 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-12 19:00:56 +0100 |
| commit | 9884e4982be942a98cf5bca9360d20cc3fca3e9d (patch) | |
| tree | 2ec0af3864f1839a8896b25090f8fa7024394fdc /keyboards/wilba_tech | |
| parent | 5478051d7470efb32783b1c4080a2c3f24ce3c24 (diff) | |
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) | |||
| 150 | void backlight_effect_indicators(void) | 150 | void backlight_effect_indicators(void) |
| 151 | { | 151 | { |
| 152 | #if defined(MONO_BACKLIGHT_WT75_A) | 152 | #if defined(MONO_BACKLIGHT_WT75_A) |
| 153 | HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; | 153 | hsv_t hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; |
| 154 | RGB rgb = hsv_to_rgb( hsv ); | 154 | rgb_t rgb = hsv_to_rgb( hsv ); |
| 155 | // SW7,CS8 = (6*8+7) = 55 | 155 | // SW7,CS8 = (6*8+7) = 55 |
| 156 | // SW8,CS8 = (7*8+7) = 63 | 156 | // SW8,CS8 = (7*8+7) = 63 |
| 157 | // SW9,CS8 = (8*8+7) = 71 | 157 | // 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) | |||
| 1258 | // Solid color | 1258 | // Solid color |
| 1259 | void backlight_effect_solid_color(void) | 1259 | void backlight_effect_solid_color(void) |
| 1260 | { | 1260 | { |
| 1261 | HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; | 1261 | hsv_t hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; |
| 1262 | RGB rgb = hsv_to_rgb( hsv ); | 1262 | rgb_t rgb = hsv_to_rgb( hsv ); |
| 1263 | backlight_set_color_all( rgb.r, rgb.g, rgb.b ); | 1263 | backlight_set_color_all( rgb.r, rgb.g, rgb.b ); |
| 1264 | } | 1264 | } |
| 1265 | 1265 | ||
| 1266 | // alphas = color1, mods = color2 | 1266 | // alphas = color1, mods = color2 |
| 1267 | void backlight_effect_alphas_mods(void) | 1267 | void backlight_effect_alphas_mods(void) |
| 1268 | { | 1268 | { |
| 1269 | RGB rgb1 = hsv_to_rgb( (HSV){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } ); | 1269 | rgb_t rgb1 = hsv_to_rgb( (hsv_t){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } ); |
| 1270 | RGB rgb2 = hsv_to_rgb( (HSV){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } ); | 1270 | rgb_t rgb2 = hsv_to_rgb( (hsv_t){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } ); |
| 1271 | bool is_alpha = false; | 1271 | bool is_alpha = false; |
| 1272 | for ( int row = 0; row < MATRIX_ROWS; row++ ) | 1272 | for ( int row = 0; row < MATRIX_ROWS; row++ ) |
| 1273 | { | 1273 | { |
| @@ -1352,8 +1352,8 @@ void backlight_effect_gradient_up_down(void) | |||
| 1352 | int16_t s2 = g_config.color_2.s; | 1352 | int16_t s2 = g_config.color_2.s; |
| 1353 | int16_t deltaS = ( s2 - s1 ) / 4; | 1353 | int16_t deltaS = ( s2 - s1 ) / 4; |
| 1354 | 1354 | ||
| 1355 | HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; | 1355 | hsv_t hsv = { .h = 0, .s = 255, .v = g_config.brightness }; |
| 1356 | RGB rgb; | 1356 | rgb_t rgb; |
| 1357 | Point point; | 1357 | Point point; |
| 1358 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) | 1358 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) |
| 1359 | { | 1359 | { |
| @@ -1390,8 +1390,8 @@ void backlight_effect_raindrops(bool initialize) | |||
| 1390 | int16_t s2 = g_config.color_2.s; | 1390 | int16_t s2 = g_config.color_2.s; |
| 1391 | int16_t deltaS = ( s2 - s1 ) / 4; | 1391 | int16_t deltaS = ( s2 - s1 ) / 4; |
| 1392 | 1392 | ||
| 1393 | HSV hsv; | 1393 | hsv_t hsv; |
| 1394 | RGB rgb; | 1394 | rgb_t rgb; |
| 1395 | 1395 | ||
| 1396 | // Change one LED every tick | 1396 | // Change one LED every tick |
| 1397 | uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % BACKLIGHT_LED_COUNT : 255; | 1397 | uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % BACKLIGHT_LED_COUNT : 255; |
| @@ -1431,8 +1431,8 @@ void backlight_effect_cycle_all(void) | |||
| 1431 | #endif | 1431 | #endif |
| 1432 | offset2 = (offset2<=63) ? (63-offset2) : 0; | 1432 | offset2 = (offset2<=63) ? (63-offset2) : 0; |
| 1433 | 1433 | ||
| 1434 | HSV hsv = { .h = offset+offset2, .s = 255, .v = g_config.brightness }; | 1434 | hsv_t hsv = { .h = offset+offset2, .s = 255, .v = g_config.brightness }; |
| 1435 | RGB rgb = hsv_to_rgb( hsv ); | 1435 | rgb_t rgb = hsv_to_rgb( hsv ); |
| 1436 | backlight_set_color( i, rgb.r, rgb.g, rgb.b ); | 1436 | backlight_set_color( i, rgb.r, rgb.g, rgb.b ); |
| 1437 | } | 1437 | } |
| 1438 | } | 1438 | } |
| @@ -1440,8 +1440,8 @@ void backlight_effect_cycle_all(void) | |||
| 1440 | void backlight_effect_cycle_left_right(void) | 1440 | void backlight_effect_cycle_left_right(void) |
| 1441 | { | 1441 | { |
| 1442 | uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; | 1442 | uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; |
| 1443 | HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; | 1443 | hsv_t hsv = { .h = 0, .s = 255, .v = g_config.brightness }; |
| 1444 | RGB rgb; | 1444 | rgb_t rgb; |
| 1445 | Point point; | 1445 | Point point; |
| 1446 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) | 1446 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) |
| 1447 | { | 1447 | { |
| @@ -1467,8 +1467,8 @@ void backlight_effect_cycle_left_right(void) | |||
| 1467 | void backlight_effect_cycle_up_down(void) | 1467 | void backlight_effect_cycle_up_down(void) |
| 1468 | { | 1468 | { |
| 1469 | uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; | 1469 | uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; |
| 1470 | HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; | 1470 | hsv_t hsv = { .h = 0, .s = 255, .v = g_config.brightness }; |
| 1471 | RGB rgb; | 1471 | rgb_t rgb; |
| 1472 | Point point; | 1472 | Point point; |
| 1473 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) | 1473 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) |
| 1474 | { | 1474 | { |
| @@ -1493,8 +1493,8 @@ void backlight_effect_cycle_up_down(void) | |||
| 1493 | 1493 | ||
| 1494 | void backlight_effect_jellybean_raindrops( bool initialize ) | 1494 | void backlight_effect_jellybean_raindrops( bool initialize ) |
| 1495 | { | 1495 | { |
| 1496 | HSV hsv; | 1496 | hsv_t hsv; |
| 1497 | RGB rgb; | 1497 | rgb_t rgb; |
| 1498 | 1498 | ||
| 1499 | // Change one LED every tick | 1499 | // Change one LED every tick |
| 1500 | uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % BACKLIGHT_LED_COUNT : 255; | 1500 | 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 ) | |||
| 1519 | void backlight_effect_cycle_radial1(void) | 1519 | void backlight_effect_cycle_radial1(void) |
| 1520 | { | 1520 | { |
| 1521 | uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; | 1521 | uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; |
| 1522 | HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; | 1522 | hsv_t hsv = { .h = 0, .s = 255, .v = g_config.brightness }; |
| 1523 | RGB rgb; | 1523 | rgb_t rgb; |
| 1524 | Point point; | 1524 | Point point; |
| 1525 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) | 1525 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) |
| 1526 | { | 1526 | { |
| @@ -1537,8 +1537,8 @@ void backlight_effect_cycle_radial2(void) | |||
| 1537 | { | 1537 | { |
| 1538 | uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; | 1538 | uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; |
| 1539 | 1539 | ||
| 1540 | HSV hsv = { .h = 0, .s = g_config.color_1.s, .v = g_config.brightness }; | 1540 | hsv_t hsv = { .h = 0, .s = g_config.color_1.s, .v = g_config.brightness }; |
| 1541 | RGB rgb; | 1541 | rgb_t rgb; |
| 1542 | Point point; | 1542 | Point point; |
| 1543 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) | 1543 | for ( int i=0; i<BACKLIGHT_LED_COUNT; i++ ) |
| 1544 | { | 1544 | { |
| @@ -1559,10 +1559,10 @@ void backlight_effect_cycle_radial2(void) | |||
| 1559 | #if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C) | 1559 | #if defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_M10_C) |
| 1560 | void backlight_effect_custom_colors(void) | 1560 | void backlight_effect_custom_colors(void) |
| 1561 | { | 1561 | { |
| 1562 | RGB rgb; | 1562 | rgb_t rgb; |
| 1563 | for ( uint8_t i = 0; i < RGB_BACKLIGHT_CUSTOM_COLORS_COUNT; i++ ) | 1563 | for ( uint8_t i = 0; i < RGB_BACKLIGHT_CUSTOM_COLORS_COUNT; i++ ) |
| 1564 | { | 1564 | { |
| 1565 | HSV hsv = { .h = g_config.custom_color[i].h, .s = g_config.custom_color[i].s, .v = g_config.brightness }; | 1565 | hsv_t hsv = { .h = g_config.custom_color[i].h, .s = g_config.custom_color[i].s, .v = g_config.brightness }; |
| 1566 | rgb = hsv_to_rgb( hsv ); | 1566 | rgb = hsv_to_rgb( hsv ); |
| 1567 | uint8_t led; | 1567 | uint8_t led; |
| 1568 | map_row_column_to_led( 0, i, &led ); | 1568 | map_row_column_to_led( 0, i, &led ); |
| @@ -1580,8 +1580,8 @@ void backlight_effect_custom_colors(void) | |||
| 1580 | 1580 | ||
| 1581 | void backlight_effect_indicators_set_colors( uint8_t index, HS color ) | 1581 | void backlight_effect_indicators_set_colors( uint8_t index, HS color ) |
| 1582 | { | 1582 | { |
| 1583 | HSV hsv = { .h = color.h, .s = color.s, .v = g_config.brightness }; | 1583 | hsv_t hsv = { .h = color.h, .s = color.s, .v = g_config.brightness }; |
| 1584 | RGB rgb = hsv_to_rgb( hsv ); | 1584 | rgb_t rgb = hsv_to_rgb( hsv ); |
| 1585 | if ( index == 254 ) | 1585 | if ( index == 254 ) |
| 1586 | { | 1586 | { |
| 1587 | backlight_set_color_all( rgb.r, rgb.g, rgb.b ); | 1587 | backlight_set_color_all( rgb.r, rgb.g, rgb.b ); |
