|
Swadge ESP32-S2
APIs to develop for the Magfest Swadge
|
These are a collection of functions to convert from red, green, blue (RGB) to hue, saturation, value (HSV) color spaces.
Functions can also convert between the paletteColor_t enum and the RGB color space.
Call the functions as necessary.
Go to the source code of this file.
Functions | |
| 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). | |
| 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. | |
| paletteColor_t | paletteHsvToHex (uint8_t hue, uint8_t sat, uint8_t val) |
| This converts a hue, saturation, and value (HSV) into paletteColor_t color. | |
| paletteColor_t | RGBtoPalette (uint32_t rgb) |
| Find the palette color closest to the given 32 bit RGB color. | |
| uint32_t | paletteToRGB (paletteColor_t pal) |
| Find the 32 bit RGB color for the given palette color. | |
Variables | |
| const uint32_t | gamma_correction_table [256] |
| A LUT which maps perceived brightness to LED brightness. | |
| 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).
| hue | Hue, the color, 0..255 |
| sat | Saturation, how intense the color is, 0..255 |
| val | Value, how bright the color is, 0..255 |
| applyGamma | Whether or not to apply gamma to the output |
| led_t LedEHSVtoHEXhelper | ( | uint8_t | hue, |
| uint8_t | sat, | ||
| uint8_t | val, | ||
| bool | applyGamma ) |
| paletteColor_t paletteHsvToHex | ( | uint8_t | hue, |
| uint8_t | sat, | ||
| uint8_t | val ) |
This converts a hue, saturation, and value (HSV) into paletteColor_t color.
| hue | Hue, the color, 0..255 |
| sat | Saturation, how intense the color is, 0..255 |
| val | Value, how bright the color is, 0..255 |
| paletteColor_t RGBtoPalette | ( | uint32_t | rgb | ) |
Find the palette color closest to the given 32 bit RGB color.
| rgb | A 32 bit RGB color (0xBBGGRR) |
| uint32_t paletteToRGB | ( | paletteColor_t | pal | ) |
Find the 32 bit RGB color for the given palette color.
| pal | A palette color |
|
extern |
A LUT which maps perceived brightness to LED brightness.
A table that can be used for gamma correction.
A LUT which maps perceived brightness to LED brightness.
Maps a uint8_t value to a gamma-corrected uint8_t.