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

◆ fill()

void mood_ring::RingCanvas::fill ( const RGBf & color,
float gain )

Add the same colour to every pixel.

Definition at line 98 of file ring_canvas.cpp.

98 {
99 const int n = size();
100 if (n <= 0 || gain <= 0.0f)
101 return;
102 for (int i = 0; i < n; ++i) {
103 RGBf &p = mPx[static_cast<fl::size>(i)];
104 p.r += color.r * gain;
105 p.g += color.g * gain;
106 p.b += color.b * gain;
107 }
108}
fl::span< RGBf > mPx
Definition ring_canvas.h:92

References mood_ring::RGBf::b, mood_ring::RGBf::g, mPx, mood_ring::RGBf::r, and size().

Referenced by mood_ring::BreathLayer::render(), mood_ring::FlowLayer::render(), and mood_ring::GrooveLayer::render().

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