mca-pendel/sketches/pendulum/color_hsv.h

27 lines
468 B
C
Raw Permalink Normal View History

2018-03-27 01:59:25 +02:00
#ifndef _COLOR_HSV_H_
#define _COLOR_HSV_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 init_hsv_t(uint16_t hue, uint8_t sat, uint8_t val);
rgb_t hsv2rgb(hsv_t* hsv);
void hsv2rgbList(hsv_t* hsvList, rgb_t* rgbList, size_t count);
void interpolate(hsv_t start, hsv_t end, size_t steps, hsv_t *colors);
#endif