Im away from home, and have been brainstorming how this would work, to make a train loading bay make a wave while waiting. Is this just dealing RGB ramps, or is it also doing CYM?
Just shifting RGB values; you can get a rainbow with RGB values by starting with Red (255,0,0) then increasing the Green value to 255, followed by reducing the Red to 0. Then increase blue to 255, Green to 0, Red to 255, Blue to 0. That gets you a Red -> Yellow -> Green -> Aqua -> Blue ->Pink -> Red.
The way I logicked it out was by realizing that there are 6 different shifting states between the colors in the pattern, and each has a unique set of identifiers, for instance, you can identify that Red's hue should be increasing at any particular moment by the fact that Green should be less than or equal to 0, Blue should be greater than or equal to 255, and Red should be less than 255. Once I realized that, it was just a case of assigning two decider combinators to each hue and setting a variable (I used 'R' 'G' and 'B', for obvious reasons) to either 1, or -1 depending on whether that hue should be increasing or decreasing. Leaving the else statements blank results in a 0, for when that hue shouldn't be increasing or decreasing. Then I just hooked each pair of deciders to an arithmetic combinator looping back on itself so it added the variable to the hue of its associated color each tick and tada! Shifting night light.
You can change the value of the shifter variable too to speed up the shifting, the video has them all set to 2/-2 since otherwise it takes over 25 seconds to cycle through the spectrum. It is kind of tricky to initialize though, since none of the states ever have all the values set to 0, and you can't just use a constant combinator (at least you cant with the way I did things), so I ended up hooking up a decider combinator with an always-true condition setting Red to 255, then deconstructing it once Green got up to 255. A little bit janky, but you only need to do it once.
As for your wave idea, you ought to be able to use the same principle to make a light rapidly shift between white and blue. Just use a very high shifter variable, and make it so that the decider only switched states when the hue is far above 255 or below 0, since those values are still valid, it just rounds them to the 0-255 range. Could be tricky offsetting the lights, but doable for sure.
2
u/FyallKindmurr 3d ago
Im away from home, and have been brainstorming how this would work, to make a train loading bay make a wave while waiting. Is this just dealing RGB ramps, or is it also doing CYM?
2
u/Terrulin 2d ago
I recently made something like this with a parameter for how quickly it went through the colors. It runs on a timer though.