|
M5Unit-RGB 0.0.2 git rev:51dfbe6
|
Utilities for M5Unit-RGB. More...
#include <cstdint>Go to the source code of this file.
Namespaces | |
| namespace | m5 |
| Top level namespace of M5Stack. | |
Functions | |
| uint32_t | m5::unit::rgb::hsv2rgb (const uint8_t h, const uint8_t s, const uint8_t v) |
| HSV to RGB. | |
| uint8_t | m5::unit::rgb::scale8 (const uint8_t a, const uint8_t b) |
| Rounded 8-bit scale (divide-by-255) | |
Utilities for M5Unit-RGB.
| uint32_t m5::unit::rgb::hsv2rgb | ( | const uint8_t | h, |
| const uint8_t | s, | ||
| const uint8_t | v ) |
HSV to RGB.
| h | Hue (0-255) |
| s | Saturation (0-255) |
| v | Value (0-255) |
|
inline |
Rounded 8-bit scale (divide-by-255)
| a | Value to scale (0-255) |
| b | Scale factor (0-255, where 255 = 100%) |
(a * b + 127) / 255. Maps scale8(255, 255) == 255 exactly (>> 8 would give 254).