This commit is contained in:
Passthem
2025-04-14 16:02:39 +08:00
parent d9c6c1b4b7
commit f23f7b05b2
9 changed files with 47 additions and 45 deletions

22
include/color_utils.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef COLOR_UTILS_H
#define COLOR_UTILS_H
#include <math.h>
#include <stdint.h>
typedef struct Color {
uint8_t g;
uint8_t r;
uint8_t b;
} Color;
Color hex_to_color(int hex);
Color hsv_to_color(double h, double s, double v);
void set_color(uint8_t* buffer, const Color color);
int construct_buffer(uint8_t* buffer,
const Color* colors,
const int num_leds,
const int color_bytes,
const int res_bytes);
#endif