]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/rgb_matrix_animations/colorband_val_anim.h
4b76924db9fd8c2caf64ca38a925387560902b35
[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 void BAND_VAL_math(HSV* hsv, uint8_t i, uint8_t time) {
6     int16_t v = rgb_matrix_config.val - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8;
7     hsv->v = scale8(v < 0 ? 0 : v, rgb_matrix_config.val);
8 }
9
10 bool BAND_VAL(effect_params_t* params) {
11     return effect_runner_i(params, &BAND_VAL_math);
12 }
13
14 #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
15 #endif // DISABLE_RGB_MATRIX_BAND_VAL