modm API documentation

Classes

class  modm::color::BrightnessT< T >
 Brightness as unsigned integral. Add's the math for conversion to and from Color-Types. Use with: Grayscale Buffers, Dimmed LEDs, Brightness sensors More...
 
class  modm::color::HsvT< T >
 Color in HSV Colorspace More...
 
class  modm::color::Rgb565
 
class  modm::color::RgbT< T >
 

Typedefs

using modm::color::Brightness = BrightnessT< uint8_t >
 
using modm::color::Hsv = HsvT< uint8_t >
 
using modm::color::Rgb = RgbT< uint8_t >
 

Functions

template<std::unsigned_integral U>
IOStreammodm::color::operator<< (IOStream &os, const color::HsvT< U > &color)
 
template<std::unsigned_integral T, typename IntermediateType = float, std::unsigned_integral ReturnType = T>
requires constexpr std::is_fundamental_v< IntermediateType > RgbT< ReturnType > modm::color::normalizeColor (RgbT< T > rgb, IntermediateType multiplier=1)
 
template<std::unsigned_integral U>
IOStreammodm::color::operator<< (IOStream &os, const color::RgbT< U > &color)
 

Detailed Description

lbuild module: modm:ui:color

Color containers and converters in various formats: RGB, HSV, Brightness, Rgb565

Function Documentation

template<std::unsigned_integral T, typename IntermediateType = float, std::unsigned_integral ReturnType = T>
requires constexpr std::is_fundamental_v<IntermediateType> RgbT<ReturnType> modm::color::normalizeColor ( RgbT< T >  rgb,
IntermediateType  multiplier = 1 
)
constexpr

Normalize color values based on a clear value

Imagine a low band light, for example a green laser. In case the filters of a sensor do not transfer this wavelength well, it might result in all colors being very low. An aditional clear value (provided f.e. by TCS3472) will not filter colors and thus it will see a bright light (intensity). In order to still have some signal the very low green value can be amplified with the clear value.