| 41 | |
| 42 | struct VisitorFill { |
| 43 | VisitorFill(span<const u8> indices, span<CRGB> output) |
| 44 | : output(output), indices(indices) { |
| 45 | // This assert was triggering on the corkscrew example. Not sure why |
| 46 | // but the corrective action of taking the min was corrective action. |
| 47 | // FASTLED_ASSERT( |
| 48 | // indices.size() == output.size(), |
| 49 | // "Gradient::fill: indices and output must be the same size" |
| 50 | // "\nSize was" << indices.size() << " and " << output.size()); |
| 51 | n = fl::min(indices.size(), output.size()); |
| 52 | } |
| 53 | void accept(const CRGBPalette16 *palette) { |
| 54 | for (fl::size i = 0; i < n; ++i) { |
| 55 | output[i] = ColorFromPalette(*palette, indices[i]); |