Chance to Illuminate LEDs with Colors from a Specific Spectrum?

Greetings! I am in the process of crafting an LED "Whirlpool", ( in the process: meaning it's built, and here it is in it's current form, ) but I am looking for guidance on code assistance. I am still awaiting the arrival of a component to finish off the rest of the build, but I figured I would get started on the code in the meantime.

So, this unit fits onto the bottom of an upright bass that I recently finished building, (woohoo!), and I am planning on having the output of the bass be reflected into the LEDs, (0% output = 0% lights illuminated, 40% output = 40% lights illuminated, and so on.)

The portion of the code that I would like assistance on is the color of these LEDs. For the color theme, I'm looking to have the LEDs be blue, green or purple. My idea is to have these lights be anything in the defined spectrum of each color, (0-255, 0-255, 0-255) style, but I want the specific values to change each time the light re-illuminates, with a chance of changing between the three spectrums.

I'll try to explain this in code form, minus the code part....

if input is 0%, illuminate 0% of LEDs; if input is 50%, illuminate 50% of LEDs;

LEDs 1-10 40% chance of (0, 0, 0-255); if not 40% chance of (0, 0-255, 0); if not 100% chance of (0-255, 0, 0-255); after LED turns off, reset color values for given LED;

LEDs 11-20 40% chance of (0, 0, 0-255); if not 40% chance of (0, 0-255, 0); if not 100% chance of (0-255, 0, 0-255); after LED turns off, reset color values for given LED;

So like I said, I believe I have the intensity of the input and lights synced together, I just need to figure out how to have these colors to be present each time they illuminate in the given spectrums, and change the values each time the LED turns off and back on.

Post the code, using code tags, and explain what is going wrong.

The thing is I don’t have code yet for the color alterations! :frowning:

If you want someone to write code for you, post in the Gigs & Collaborations section. You will need to explain what hardware you have, before anyone can start.

I have all the code, just not sure what the right code keywords would be for the specific color changes. If you think I should try posting it there, I wouldn't mind, assistance is assistance!