qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

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 
     19 static hsv_t RGB_TESTING_math(hsv_t hsv, uint8_t i, uint8_t time) {
     20     hsv.v = 255;
     21     hsv.s = 255;
     22 
     23     uint8_t t = (time + i * 6) % 256;
     24     switch (t / (256 / 4)) {
     25         case 0:
     26             hsv.h = 0;
     27             break;
     28         case 1:
     29             hsv.h = 85;
     30             break;
     31         case 2:
     32             hsv.h = 170;
     33             break;
     34         default:
     35             hsv.s = 0;
     36     }
     37     return hsv;
     38 }
     39 
     40 static bool RGB_TESTING(effect_params_t* params) { return effect_runner_i(params, &RGB_TESTING_math); }
     41 #endif