| 8 | #endif |
| 9 | |
| 10 | fl::ScreenMap makeRingScreenMap(int numLeds, int gridWidth, int gridHeight, |
| 11 | float diameter) { |
| 12 | return fl::ScreenMap(numLeds, diameter, [=](int index, fl::vec2f &pt_out) { |
| 13 | float centerX = gridWidth / 2.0f; |
| 14 | float centerY = gridHeight / 2.0f; |
| 15 | float radius = fl::min(gridWidth, gridHeight) / 2.0f - 1; |
| 16 | float angle = (TWO_PI * index) / numLeds; |
| 17 | pt_out.x = centerX + fl::cos(angle) * radius; |
| 18 | pt_out.y = centerY + fl::sin(angle) * radius; |
| 19 | }); |
| 20 | } |