diff options
Diffstat (limited to 'include/ws2812b.h')
-rw-r--r-- | include/ws2812b.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/ws2812b.h b/include/ws2812b.h index 2061379..6f8aff0 100644 --- a/include/ws2812b.h +++ b/include/ws2812b.h @@ -45,11 +45,23 @@ typedef struct { uint8_t r; uint8_t g; uint8_t b; + + /* Color alpha. 0 is perfectly opaque, 255 is perfectly transparent). */ + uint8_t a; }; uint32_t color; }; } rgb_t; +typedef struct { + uint8_t mat[4][4]; +} rgb_mat_t; + +/** Returns the new RGB as if rgb1 was overlayed on top of rgb2. */ +rgb_t blend(rgb_t rgb1, rgb_t rgb2); + +rgb_t mat_mul(rgb_t rgb, const rgb_mat_t* mat); + int write_rgb(struct ws2812b_buf* out, rgb_t color); void start_dma(struct ws2812b_buf* buf); |