Artificer Dice v4.0 Dev Log 2 - Color Profiles
I sat down and played around with the colors a little more; I wanted to create a lighting profile for the six primary/secondary colors, and figure out how to easily switch between them.
I can’t remember exactly how/why I coded the lighting pattern the way I did back in 2019, but they essentially work through twelve variables:
RGB On Color [Ron, Gon, Bon]
RGB On Gradient [fRon…]
RGB Off Color [Roff…]
RGB Off Gradient [fRoff…]
The effect this has is that the color doesn’t change linearly, and can have subtle shifts across the loop. A bright warm yellow can fade to a reddish ember, or a sickly green, without a sudden shift in the color once it goes from ON to OFF. I haven’t quite gotten the hang of capturing the subtle changes on video.
These were all tested out on a draft print of the Dev Model with some quick etched acrylic windows to catch the light of a Neopixel ring.
The new function I learned to accomplish this was using Multi-Dimensional arrays to encapsulate all twelve values across each of the six colors. Now all I have to do is change a single value to change the color profile. Code can be found here. This was also my first time using Wokwi, I have NO idea how I got this far without any sort of code simulator.
The code itself still isn’t perfect; I need to implement some funciton that prevents the same light being picked twice. There should be a total of eight lights turning on and off, sometimes it’s as low as five. It may seem like a low priority, but figuring that out will go a long way in creating more animations that utilize all of the lights.