Rename RGB/HSV structs: keyboard-level code (#24476)

This commit is contained in:
Ryan 2024-10-13 05:00:56 +11:00 committed by GitHub
parent 5478051d74
commit 9884e4982b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 215 additions and 215 deletions

View file

@ -57,8 +57,8 @@ and sets val to RGB_MATRIX_MAXIMUM_BRIGHTNESS (by default, 255)
This is applied to both caps lock, and other indicator keys for layer 1 */
bool rgb_matrix_indicators_user(void) {
HSV hsv_ind = {rgb_matrix_get_hue()+30,255,RGB_MATRIX_MAXIMUM_BRIGHTNESS};
RGB rgb_ind = hsv_to_rgb(hsv_ind);
hsv_t hsv_ind = {rgb_matrix_get_hue()+30,255,RGB_MATRIX_MAXIMUM_BRIGHTNESS};
rgb_t rgb_ind = hsv_to_rgb(hsv_ind);
/* Sets Caps to different color as indicator. If RGB mode is rain, and caps indicator is off, the LED will always be off.
This is to avoid having the LED persist on until the animation randomly refreshes it. */
@ -70,8 +70,8 @@ bool rgb_matrix_indicators_user(void) {
/* Sets W, A, S, D, LGUI to a different color as layer indicator */
if(IS_LAYER_ON(1)) {
HSV hsv_ind = {rgb_matrix_get_hue()+30,255,RGB_MATRIX_MAXIMUM_BRIGHTNESS};
RGB rgb_ind = hsv_to_rgb(hsv_ind);
hsv_t hsv_ind = {rgb_matrix_get_hue()+30,255,RGB_MATRIX_MAXIMUM_BRIGHTNESS};
rgb_t rgb_ind = hsv_to_rgb(hsv_ind);
rgb_matrix_set_color(W_LED_INDEX, rgb_ind.r, rgb_ind.g, rgb_ind.b);
rgb_matrix_set_color(A_LED_INDEX, rgb_ind.r, rgb_ind.g, rgb_ind.b);
@ -85,8 +85,8 @@ bool rgb_matrix_indicators_user(void) {
layer_state_t layer_state_set_user(layer_state_t state) {
/* If reverting to base layer (no special LED effects) and rain animation is on, set "layer 1" mods back to matrix color to avoid single key persistence*/
if(!IS_LAYER_ON_STATE(state, 1) && rgb_matrix_get_mode() == 10) {
HSV hsv_mat = rgb_matrix_get_hsv();
RGB rgb_mat = hsv_to_rgb(hsv_mat);
hsv_t hsv_mat = rgb_matrix_get_hsv();
rgb_t rgb_mat = hsv_to_rgb(hsv_mat);
rgb_matrix_set_color(W_LED_INDEX, rgb_mat.r, rgb_mat.g, rgb_mat.b);
rgb_matrix_set_color(A_LED_INDEX, rgb_mat.r, rgb_mat.g, rgb_mat.b);

View file

@ -57,8 +57,8 @@ and sets val to RGB_MATRIX_MAXIMUM_BRIGHTNESS (by default, 255)
This is applied to both caps lock, and other indicator keys for layer 1 */
bool rgb_matrix_indicators_user(void) {
HSV hsv_ind = {rgb_matrix_get_hue()+30,255,RGB_MATRIX_MAXIMUM_BRIGHTNESS};
RGB rgb_ind = hsv_to_rgb(hsv_ind);
hsv_t hsv_ind = {rgb_matrix_get_hue()+30,255,RGB_MATRIX_MAXIMUM_BRIGHTNESS};
rgb_t rgb_ind = hsv_to_rgb(hsv_ind);
/* Sets Caps to different color as indicator. If RGB mode is rain, and caps indicator is off, the LED will always be off.
This is to avoid having the LED persist on until the animation randomly refreshes it. */
@ -70,8 +70,8 @@ bool rgb_matrix_indicators_user(void) {
/* Sets W, A, S, D, LGUI to a different color as layer indicator */
if(IS_LAYER_ON(1)) {
HSV hsv_ind = {rgb_matrix_get_hue()+30,255,RGB_MATRIX_MAXIMUM_BRIGHTNESS};
RGB rgb_ind = hsv_to_rgb(hsv_ind);
hsv_t hsv_ind = {rgb_matrix_get_hue()+30,255,RGB_MATRIX_MAXIMUM_BRIGHTNESS};
rgb_t rgb_ind = hsv_to_rgb(hsv_ind);
rgb_matrix_set_color(W_LED_INDEX, rgb_ind.r, rgb_ind.g, rgb_ind.b);
rgb_matrix_set_color(A_LED_INDEX, rgb_ind.r, rgb_ind.g, rgb_ind.b);
@ -85,8 +85,8 @@ bool rgb_matrix_indicators_user(void) {
layer_state_t layer_state_set_user(layer_state_t state) {
/* If reverting to base layer (no special LED effects) and rain animation is on, set "layer 1" mods back to matrix color to avoid single key persistence*/
if(!IS_LAYER_ON_STATE(state, 1) && rgb_matrix_get_mode() == 10) {
HSV hsv_mat = rgb_matrix_get_hsv();
RGB rgb_mat = hsv_to_rgb(hsv_mat);
hsv_t hsv_mat = rgb_matrix_get_hsv();
rgb_t rgb_mat = hsv_to_rgb(hsv_mat);
rgb_matrix_set_color(W_LED_INDEX, rgb_mat.r, rgb_mat.g, rgb_mat.b);
rgb_matrix_set_color(A_LED_INDEX, rgb_mat.r, rgb_mat.g, rgb_mat.b);

View file

@ -18,13 +18,13 @@ static bool SINGLE_COLOR_RAINDROPS(effect_params_t* params) {
}
// Take matrix color, add between -5 and +5 to hue, random brightness between 0 and val, set to 0 if val between 0 and 5, then write to LED
HSV hsv = rgb_matrix_get_hsv();
hsv_t hsv = rgb_matrix_get_hsv();
hsv.h = rgb_matrix_get_hue() - 2 + random8() % 5;
hsv.v = random8() % rgb_matrix_get_val();
if (hsv.v < 5) {
hsv.v = 0;
}
RGB rgb = rgb_matrix_hsv_to_rgb(hsv);
rgb_t rgb = rgb_matrix_hsv_to_rgb(hsv);
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
wait_timer = g_rgb_timer + interval();
}
@ -51,7 +51,7 @@ bool STATIC_GAME_MODE(effect_params_t* params) {
return;
}
HSV hsv = rgb_matrix_get_hsv();
hsv_t hsv = rgb_matrix_get_hsv();
switch (i) {
case W_LED_INDEX:
@ -92,7 +92,7 @@ bool STATIC_GAME_MODE(effect_params_t* params) {
break;
}
RGB rgb = hsv_to_rgb(hsv);
rgb_t rgb = hsv_to_rgb(hsv);
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
}