aboutsummaryrefslogtreecommitdiff
path: root/keyboards/wilba_tech/wt_rgb_backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/wilba_tech/wt_rgb_backlight.c')
-rw-r--r--keyboards/wilba_tech/wt_rgb_backlight.c48
1 files changed, 24 insertions, 24 deletions
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 );