Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
color_utils.h
Go to the documentation of this file.
1
32#ifndef _COLOR_UTILS_H_
33#define _COLOR_UTILS_H_
34
35#include <stdint.h>
36#include <stdbool.h>
37
38#include "palette.h"
39#include "hdw-led.h"
40
42extern const uint32_t gamma_correction_table[256];
43
44uint32_t EHSVtoHEXhelper(uint8_t hue, uint8_t sat, uint8_t val, bool applyGamma);
45led_t LedEHSVtoHEXhelper(uint8_t hue, uint8_t sat, uint8_t val, bool applyGamma);
46paletteColor_t paletteHsvToHex(uint8_t hue, uint8_t sat, uint8_t val);
47paletteColor_t RGBtoPalette(uint32_t rgb);
48uint32_t paletteToRGB(paletteColor_t pal);
49
50#endif
paletteColor_t RGBtoPalette(uint32_t rgb)
Find the palette color closest to the given 32 bit RGB color.
Definition color_utils.c:158
paletteColor_t paletteHsvToHex(uint8_t hue, uint8_t sat, uint8_t val)
This converts a hue, saturation, and value (HSV) into paletteColor_t color.
Definition color_utils.c:147
const uint32_t gamma_correction_table[256]
A LUT which maps perceived brightness to LED brightness.
Definition color_utils.c:17
led_t LedEHSVtoHEXhelper(uint8_t hue, uint8_t sat, uint8_t val, bool applyGamma)
This converts a hue, saturation, and value (HSV) into led_t color.
Definition color_utils.c:129
uint32_t EHSVtoHEXhelper(uint8_t hue, uint8_t sat, uint8_t val, bool applyGamma)
This converts a hue, saturation, and value (HSV) into 32 bit RGB (0xBBGGRR)
Definition color_utils.c:43
uint32_t paletteToRGB(paletteColor_t pal)
Find the 32 bit RGB color for the given palette color.
Definition color_utils.c:175
LED colors, with red, green, and blue components.
Definition hdw-led.h:63
paletteColor_t
All 216 possible colors, named like cRGB.
Definition palette.h:23