]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/rgb_matrix_animations/colorband_val_anim.h
Switching rgb_config_t to use HSV struct
[qmk_firmware.git] / quantum / rgb_matrix_animations / colorband_val_anim.h
1 #ifndef DISABLE_RGB_MATRIX_BAND_VAL
2 RGB_MATRIX_EFFECT(BAND_VAL)
3 #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
4
5 static HSV BAND_VAL_math(HSV hsv, uint8_t i, uint8_t time) {
6     int16_t v = hsv.v - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8;
7     hsv.v = scale8(v < 0 ? 0 : v, hsv.v);
8     return hsv;
9 }
10
11 bool BAND_VAL(effect_params_t* params) {
12     return effect_runner_i(params, &BAND_VAL_math);
13 }
14
15 #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
16 #endif // DISABLE_RGB_MATRIX_BAND_VAL