You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
523 B

  1. // Copyright 2022 Makoto Kurauchi (@MakotoKurauchi)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "ws2812.h"
  5. #include "color.h"
  6. static inline void rgblite_setrgb(RGB rgb) {
  7. rgb_led_t leds[RGBLIGHT_LED_COUNT] = {{.r = rgb.r, .g = rgb.g, .b = rgb.b}};
  8. ws2812_setleds(leds, RGBLIGHT_LED_COUNT);
  9. }
  10. static void rgblite_increase_hue(void) {
  11. static uint8_t state = 0;
  12. HSV hsv = { 255, 255, 255 };
  13. hsv.h = state;
  14. state = (state + 8) % 256;
  15. rgblite_setrgb(hsv_to_rgb(hsv));
  16. }