splash_anim.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
  2. # if defined(ENABLE_RGB_MATRIX_SPLASH) || defined(ENABLE_RGB_MATRIX_MULTISPLASH)
  3. # ifdef ENABLE_RGB_MATRIX_SPLASH
  4. RGB_MATRIX_EFFECT(SPLASH)
  5. # endif
  6. # ifdef ENABLE_RGB_MATRIX_MULTISPLASH
  7. RGB_MATRIX_EFFECT(MULTISPLASH)
  8. # endif
  9. # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
  10. HSV SPLASH_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
  11. uint16_t effect = tick - dist;
  12. if (effect > 255) effect = 255;
  13. hsv.h += effect;
  14. hsv.v = qadd8(hsv.v, 255 - effect);
  15. return hsv;
  16. }
  17. # ifdef ENABLE_RGB_MATRIX_SPLASH
  18. bool SPLASH(effect_params_t* params) {
  19. return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SPLASH_math);
  20. }
  21. # endif
  22. # ifdef ENABLE_RGB_MATRIX_MULTISPLASH
  23. bool MULTISPLASH(effect_params_t* params) {
  24. return effect_runner_reactive_splash(0, params, &SPLASH_math);
  25. }
  26. # endif
  27. # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
  28. # endif // !defined(ENABLE_RGB_MATRIX_SPLASH) || !defined(ENABLE_RGB_MATRIX_MULTISPLASH)
  29. #endif // RGB_MATRIX_KEYREACTIVE_ENABLED