FastLED 3.9.15
Loading...
Searching...
No Matches

◆ PaintBrightSurprise()

void Painter::PaintBrightSurprise ( const KeyboardState & keyboard,
const int * led_column_table,
int led_column_table_length,
LedRopeInterface * led_rope )
staticprivate

Definition at line 409 of file Painter.cpp.

412 {
413
415 int total_counted = 0;
416
417 float r, g, b;
418 r = g = b = 0;
419
420 for (int i = 0; i < KeyboardState::kNumKeys; ++i) {
421 const Key& key = keyboard.mKeys[i];
422
423
424 if (key.mCurrColor.v_ > 0.0f) {
425 const Color3i rgb = key.mCurrColor.ToRGB();
426 r += rgb.r_;
427 g += rgb.g_;
428 b += rgb.b_;
429 ++total_counted;
430 }
431 }
432
433 float denom = total_counted ? total_counted : 1;
434 r /= denom;
435 g /= denom;
436 b /= denom;
437
438
439 const Color3i rgb(r, g, b);
440
441 for (int i = 0; i < led_column_table_length; ++i) {
442 const int n = led_column_table[i];
443 for (int i = 0; i < n; ++i) {
445 }
446 }
448}
LedRopeTCL led_rope(kNumKeys)
KeyboardState keyboard
static const int kNumKeys
Definition Keyboard.h:101
Key mKeys[kNumKeys]
Definition Keyboard.h:103
void RawCommitDraw()
void RawDrawPixel(const Color3i &c)
void RawBeginDraw()
uint8_t b_
Definition color.h:56
uint8_t g_
Definition color.h:56
uint8_t r_
Definition color.h:56
float v_
Definition color.h:108
Color3i ToRGB() const
Definition color.cpp:129
ColorHSV mCurrColor
Definition Keyboard.h:48

References Color3i::b_, Color3i::g_, keyboard, KeyboardState::kNumKeys, led_rope, Key::mCurrColor, Color3i::r_, ColorHSV::ToRGB(), and ColorHSV::v_.

Referenced by Paint().

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