# How to make a HUE colour node with cycling colours

I have these nodes set up. What I'm trying to achieve is, the first frame to be red (or any colour which starts from same colour and finishes on starting colour, and the last frame to be red. and the animation to cycle once through the colour spectrum between frame 0 to 50.

• Did you try to animate the hue field? Isn't that enough? If you set the color to cyan, you can even just animate the slider from 0 to 1. Commented Jun 3, 2023 at 22:55

I think a more intuitive way to achieve that will be using "Combine Color" in "HSV" mode, and animating the Hue using a driver: #frame/50

To support starting at any color, you can use a more complex formula like this: fmod(frame/50+0.5, 1) - it again divided the frame by $$50$$ to normalize the frame range to $$0..1$$ range, then offsets it by $$0.5$$ to start at that value, and since the range becomes $$0.5..1.5$$ half of it is invalid and results may vary (I expected it would get clamped but something else happens). The modulo divides it by one to take the fractional part, as on this graph:

Instead of using a complex driver like that, consider moving the driver to a separate value, and using the node system from there:

The second driver there is to automatically synchronize when you modify animation length (which might be something you don't want to do).

Geo Nodes: How can I reference total frame count for math equations?

• Regarding carlo's Method, I am able to make the cycling colours from the HUE field, but its starting from Cyan to Cyan, and I'm trying to start it from red, but the colour wont change. Here's the file shared: <img src="https://blend-exchange.com/embedImage.png?bid=VB8sBEmW" /> Commented Jun 3, 2023 at 23:44
• @blenderbreath My method starts at red. Commented Jun 3, 2023 at 23:46
• I removed the reciprocal tip as upon closer inspection it didn't quite work :P Commented Jun 3, 2023 at 23:52
• Thank you for your node examples. But I have a concerning question. Your method does start with Red, which is at 0 in the HUE field, and transitions through all the colour spectrum. But I tried with Cyan, and this colour value is at 0.5 in the HUE field, (half way) so from 0.5 to 1 I only get half the colour transition. So my question is, how to get a full colour transition, regardless where the colour value is located. So if I ask you to make a full colour transition starting with magenta which is at 0.9 the next colour at 1 is Red, and no other colour transitions are in between. Commented Jun 4, 2023 at 0:04
• Thanks for this explanation, really helpful information. Time to do more studies on drivers and nodes. Kind Regards! Commented Jun 4, 2023 at 10:45

To sweep through an arbitrary loop of colours over a defined period, you could, for example, use an arrangement like this:

..using the E eyedropper tool to match the first and last stops on the Color Ramp. Clamp must be unchecked on the Map Range.

Here's another version, looping through all hues, starting at 'Color at 0':

• I swear I didn't notice your answer when I edited mine, looks like I stole yours, blatantly :D Commented Jun 4, 2023 at 12:37
• @MarkusvonBroady Hrrrmph! :D ... (It's hard not to stand on each other's toes when there's only 1 square foot available) I think the answers are still distinct enough to leave this one up, if you don't object. OP not quite clear, and you were first. Commented Jun 4, 2023 at 16:48