FastLED 3.10.6
Loading...
Searching...
No Matches

◆ blend_oklab()

CRGB fl::blend_oklab ( const CRGB & p1,
const CRGB & p2,
fract8 amountOfP2 )

Definition at line 134 of file colorutils.cpp.hpp.

134 {
135 if (amountOfP2 == 0) { return p1; }
136 if (amountOfP2 == 255) { return p2; }
137
138 const Oklab first = rgbToOklab(p1);
139 const Oklab second = rgbToOklab(p2);
140 const float amount = static_cast<float>(amountOfP2) / 255.0f;
141 const Oklab mixed = {
142 first.lightness + (second.lightness - first.lightness) * amount,
143 first.green_red + (second.green_red - first.green_red) * amount,
144 first.blue_yellow + (second.blue_yellow - first.blue_yellow) * amount,
145 };
146 return oklabToRgb(mixed);
147}
CRGB oklabToRgb(const Oklab &lab) FL_NO_EXCEPT
Oklab rgbToOklab(const CRGB &rgb) FL_NO_EXCEPT

References FL_NO_EXCEPT.

Referenced by FL_DISABLE_WARNING().

+ Here is the caller graph for this function: