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

◆ toCRGB()

CRGB mood_ring::toCRGB ( const RGBf & p)

Definition at line 14 of file ring_canvas.cpp.

14 {
15 return CRGB(static_cast<fl::u8>(clampf(p.r, 0.0f, 1.0f) * 255.0f + 0.5f),
16 static_cast<fl::u8>(clampf(p.g, 0.0f, 1.0f) * 255.0f + 0.5f),
17 static_cast<fl::u8>(clampf(p.b, 0.0f, 1.0f) * 255.0f + 0.5f));
18}
fl::CRGB CRGB
Definition crgb.h:25
unsigned char u8
Definition stdint.h:131
float clampf(float v, float lo, float hi)
Definition ring_canvas.h:19

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

Referenced by mood_ring::MoodPainter::draw().

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