Pretty close! Index goes from 0 to 149, with only a number of nanoseconds between each consecutive call. Thus,
index/pixelCount goes from 0/150 to 149/150.
time() always outputs a fixed point number between 0 and 1. In this example, it takes 6.55 seconds to loop. Since a pattern like this probably runs at about 400FPS, all 150 calls to
render() happen within 3ms, so
time(0.1) is changing very slowly compared to how fast index is advancing.
Now we can think about
h, which will always have a value between 0 and 2. However, in any calculation of a whole frame, the entire range of h values will end up spanning an interval of length ~1, but with a starting offset coming from
time(0.1) that progresses slowly.
Values in 0…2 are fine to feed to
hsv() because it wraps inputs outside of the interval 0…1. Calling
hsv(1.05,1,1) is setting the same color as
hsv(0.05,1,1). When the length of the strip is given hues from 0.33 to 1.33, it’s a rainbow around the hue wheel that starts with green and ends with green. A little later it’s 0.5 to 1.5: cyan to cyan.
Does this make sense?