模式嗯

This commit is contained in:
Passthem
2025-04-14 16:14:11 +08:00
parent 3efe232019
commit dc2d2c0c6d
3 changed files with 16 additions and 2 deletions

View File

@ -3,6 +3,7 @@
void init_status(Status* status) {
status->index = 0;
status->time = 0;
status->mode = LIGHT_MODE_WHITE;
}
Color shader(Status* status) {
@ -10,5 +11,11 @@ Color shader(Status* status) {
return hex_to_color(0xFFFFFF);
}
return hsv_to_color(status->time * 120 + status->index * 6, 1, 1);
switch (status->mode) {
case LIGHT_MODE_RAINBOW:
return hsv_to_color(status->time * 120 + status->index * 6, 1, 1);
default:
return hex_to_color(0xFFFFFF);
}
}