27 lines
459 B
C
27 lines
459 B
C
|
#ifndef _COLORS_H_
|
||
|
#define _COLORS_H_
|
||
|
|
||
|
#include <stddef.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
#define RGB_MAX 128
|
||
|
|
||
|
typedef struct {
|
||
|
uint8_t r;
|
||
|
uint8_t g;
|
||
|
uint8_t b;
|
||
|
} rgb_t;
|
||
|
|
||
|
typedef struct {
|
||
|
uint16_t hue;
|
||
|
uint8_t sat;
|
||
|
uint8_t val;
|
||
|
} hsv_t;
|
||
|
|
||
|
hsv_t makeHSV(uint16_t hue, uint8_t sat, uint8_t val);
|
||
|
rgb_t hsv2rgb(hsv_t* hsv);
|
||
|
void hsv2rgbList(hsv_t* hsv, rgb_t* rgb, size_t count);
|
||
|
void interpolateLinearly(hsv_t start, hsv_t end, size_t steps, hsv_t *colors);
|
||
|
|
||
|
#endif
|