| 280 | } |
| 281 | |
| 282 | void XYPath::drawGradient(const Gradient &gradient, float from, float to, |
| 283 | Leds *leds, int steps) { |
| 284 | XYRasterU8Sparse &raster = get_tls_raster(); |
| 285 | raster.clear(); |
| 286 | steps = steps > 0 ? steps : calculateSteps(from, to); |
| 287 | rasterize(from, to, steps, raster); |
| 288 | raster.drawGradient(gradient, leds); |
| 289 | } |
| 290 | |
| 291 | int XYPath::calculateSteps(float from, float to) { |
| 292 | float diff = fl::clamp(fl::abs(to - from), 0.0f, 1.0f); |