20 lines
433 B
C
20 lines
433 B
C
#include "shader.h"
|
|
|
|
void init_status(Status* status) {
|
|
status->index = 0;
|
|
status->time = 0;
|
|
status->mode = LIGHT_MODE_RAINBOW;
|
|
}
|
|
|
|
Color shader(Status* status) {
|
|
if (status->index == 0) {
|
|
return hex_to_color(0xFFFFFF);
|
|
}
|
|
|
|
switch (status->mode) {
|
|
case LIGHT_MODE_RAINBOW:
|
|
return hsv_to_color(status->time * 120 + status->index * 6, 1, 1);
|
|
}
|
|
|
|
return hex_to_color(0xFFFFFF);
|
|
} |