MCPcopy Create free account
hub / github.com/FastLED/FastLED / drawGradient

Method drawGradient

src/fl/gfx/xypath.cpp.hpp:282–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void 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
291int XYPath::calculateSteps(float from, float to) {
292 float diff = fl::clamp(fl::abs(to - from), 0.0f, 1.0f);

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected