logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

rgb_matrix_user.inc (1269B)


  1. /* Copyright 2022 s-ol
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. RGB_MATRIX_EFFECT(RGB_TESTING)
  17. #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
  18. static hsv_t RGB_TESTING_math(hsv_t hsv, uint8_t i, uint8_t time) {
  19. hsv.v = 255;
  20. hsv.s = 255;
  21. uint8_t t = (time + i * 6) % 256;
  22. switch (t / (256 / 4)) {
  23. case 0:
  24. hsv.h = 0;
  25. break;
  26. case 1:
  27. hsv.h = 85;
  28. break;
  29. case 2:
  30. hsv.h = 170;
  31. break;
  32. default:
  33. hsv.s = 0;
  34. }
  35. return hsv;
  36. }
  37. static bool RGB_TESTING(effect_params_t* params) { return effect_runner_i(params, &RGB_TESTING_math); }
  38. #endif