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

◆ applyWhiteCfg()

void fl::anonymous_namespace{channel.cpp.hpp}::applyWhiteCfg ( CLEDController & ctrl,
const ChannelOptions & options )
inline

Apply the white-channel selection from ChannelOptions to a CLEDController.

The variant alternative chooses RGB-only / RGBW / RGBWW without forcing every call site to duplicate the dispatch.

Definition at line 37 of file channel.cpp.hpp.

38 {
39 if (auto* p = options.mWhiteCfg.ptr<Rgbww>()) {
40 ctrl.setRgbww(*p);
41 } else if (auto* p = options.mWhiteCfg.ptr<Rgbw>()) {
42 ctrl.setRgbw(*p);
43 } else {
44 // Empty alternative (or default-constructed) → plain RGB.
45 ctrl.clearWhiteChannel();
46 }
47}
CLEDController & setRgbw(const Rgbw &arg=RgbwDefault::value()) FL_NO_EXCEPT
CLEDController & setRgbww(const Rgbww &arg=RgbwwDefault::value()) FL_NO_EXCEPT
Configure this channel for 5-channel RGBWW (RGB + warm-W + cool-W) output.
CLEDController & clearWhiteChannel() FL_NO_EXCEPT
Reset this channel to plain 3-channel RGB (clears any RGBW/RGBWW configuration).
fl::variant< fl::Empty, Rgbw, Rgbww > mWhiteCfg
White-channel selection (variant): Empty = plain RGB, Rgbw = 4-channel, Rgbww = 5-channel.
Definition options.h:91
Per-strip RGBWW configuration.
Definition rgbww.h:60

References applyWhiteCfg(), and fl::FL_NO_EXCEPT.

Referenced by applyWhiteCfg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: