MCPcopy Create free account
hub / github.com/FastLED/FastLED / lerp_channel_to_hd

Function lerp_channel_to_hd

src/fl/gfx/colorutils.cpp.hpp:275–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275inline fl::u16 lerp_channel_to_hd(fl::u8 a, fl::u8 b, fl::u16 frac,
276 fl::u32 segment_size) {
277 const fl::u32 a_raw = static_cast<fl::u32>(a) << 8;
278 const fl::u32 b_raw = static_cast<fl::u32>(b) << 8;
279 return static_cast<fl::u16>(
280 (a_raw * (segment_size - frac) + b_raw * frac) / segment_size);
281}
282
283inline CRGB16 promote_rgb_to_hd(const CRGB &rgb) {
284 return CRGB16(u8x8::from_raw(promote_channel_to_hd(rgb.red)),

Callers 1

ColorFromPaletteHDImplFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected