- Parameters
-
now | The current time in milliseconds. Fx writers are encouraged to use this instead of millis() directly as this will more deterministic behavior. |
Implements fl::Fx.
Definition at line 21 of file redsquare.h.
21 {
24 uint16_t square_size =
Math::min(width, height) / 2;
25 uint16_t start_x = (width - square_size) / 2;
26 uint16_t start_y = (height - square_size) / 2;
27
28 for (uint16_t
x = 0;
x < width;
x++) {
29 for (uint16_t
y = 0;
y < height;
y++) {
30 uint16_t idx =
mXyMap.mapToIndex(
x,
y);
31 if (idx <
mXyMap.getTotal()) {
32 if (
x >= start_x &&
x < start_x + square_size &&
33 y >= start_y &&
y < start_y + square_size) {
35 } else {
37 }
38 }
39 }
40 }
41 }
uint16_t getHeight() const
uint16_t getWidth() const
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
References CRGB::Black, fl::Fx2d::getHeight(), fl::Fx2d::getWidth(), fl::_DrawContext::leds, fl::RedSquare::Math::min(), fl::Fx2d::mXyMap, CRGB::Red, x, and y.