Skip to content

Commit

Permalink
feat: webhid rgb effect respects current brightness
Browse files Browse the repository at this point in the history
  • Loading branch information
fdidron committed Jul 12, 2024
1 parent 27a59c8 commit b36861d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keyboards/zsa/common/rgb_matrix_kb.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ extern RGB webhid_leds[RGB_MATRIX_LED_COUNT];

static bool oryx_webhid_effect_run(effect_params_t* params) {
RGB_MATRIX_USE_LIMITS(led_min, led_max);
float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX;
for (uint8_t i = led_min; i < led_max; ++i) {
rgb_matrix_set_color(i, webhid_leds[i].r, webhid_leds[i].g, webhid_leds[i].b);
rgb_matrix_set_color(i, webhid_leds[i].r * f, webhid_leds[i].g * f, webhid_leds[i].b * f);
}
return rgb_matrix_check_finished_leds(led_max);
}
Expand Down

0 comments on commit b36861d

Please sign in to comment.