I have such a small problem with the acoustic spectrum analyzer. I use a color palette to give the diodes the right colors.
I do not want to assign the color of each diode sequentially through the loops.
When I use fill_palette, the stripes look like Figure A, I would like them to look like in Figure B. How to do it without using any loop and without using any “if”?
Something that came to mind was to use a gradient color palette and move/scale the middle anchor point(s) around based on the height of each line.
First read this to make sure you understand how a gradient color palettes works.
Normally a gradient color palette is defined and the colors and the anchor points do not change. But it is possible to change things on the fly by doing something like this: