FastLED 3.9.15
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 35 of file channel.cpp.hpp.

36 {
37 if (auto* p = options.mWhiteCfg.ptr<Rgbww>()) {
38 ctrl.setRgbww(*p);
39 } else if (auto* p = options.mWhiteCfg.ptr<Rgbw>()) {
40 ctrl.setRgbw(*p);
41 } else {
42 // Empty alternative (or default-constructed) → plain RGB.
43 ctrl.clearWhiteChannel();
44 }
45}
CLEDController & setRgbw(const Rgbw &arg=RgbwDefault::value()) FL_NOEXCEPT
CLEDController & setRgbww(const Rgbww &arg=RgbwwDefault::value()) FL_NOEXCEPT
Configure this channel for 5-channel RGBWW (RGB + warm-W + cool-W) output.
CLEDController & clearWhiteChannel() FL_NOEXCEPT
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:49
Per-strip RGBWW configuration.
Definition rgbww.h:60

References applyWhiteCfg(), and FL_NOEXCEPT.

Referenced by applyWhiteCfg().

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