It’s not impressive code, but I don’t know how to code and I couldn’t find it online so it took me some time to get right, so here’s the code if you’re gonna use a function. Improvements and criticisms welcome.
I’ve been using the same sort of logic. The only difference with mine was to also randomly change one of r, g, b to zero. I found with all of the LEDs having a value, the resultant colour often looked white-ish. The last two lines below randomly choose one to set to zero, which results in more intense colours.
Thanks very interesting. Thanks for sharing. I do plan on implementing something slightly more involved like that so I can have it randomly pull a color within certain ranges (i.e. turn all the lights a shade of blue in the between 6am -9am)
Also, I hadn’t been familiar with the getRandomTo function.