Files
my-ws2812b-led-deprecated/color_utils.h
Passthem 7e455c591a init
2025-04-11 15:40:18 +08:00

22 lines
508 B
C

#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