Code: Select all

```
[Metadata]
Author=Justin Ware (injust29.deviantart.com)
Information=Hue Rotation
License=CC BY-NC-SA
[Variables]
; Starting color/hue [0 - 5]
; 0 = Red, 1 = Orange, 2 = Yellow, 3 = Green, 4 = Blue, 5 = Magenta
; In-between values permitted (e.g. 3.5 would be a cyan color)
HueStart=0
; Value [0 - 255]
Val=255
; Saturation [0 - 1]
Sat=1.0
; Chroma
C=#Val#*#Sat#
; Direction of hue rotation
; (1) = Forward, (-1) = Backward
HueDir=(1)
; Range of hue rotation [0 - 6]
; 6 = full spectrum, 1 = one color, 2 = two colors, etc.
; (of the 6 primary/secondary colors)
HueRange=6
; Period of time (in hours) over which the color rotates [0-24]
Period=1
; colors (hue rotation)
color1="[R1:0],[G1:0],[B1:0]"
[mTime]
Measure=Time
[cHue1]
Group=Hue
Measure=Calc
Formula=(#HueStart#+6+#HueDir#*#HueRange#*FRAC(mTime/(3600*#Period#)))%6
[X1]
Measure=Calc
Formula=(#C#*(1-ABS(cHue1%2-1)))
[R1]
Measure=Calc
Formula=(cHue1<1) ? (#Val#) : ((cHue1<2) ? (X1+#Val#-#C#) : ((cHue1<3) ? (#Val#-#C#) : ((cHue1<4) ? (#Val#-#C#) : ((cHue1<5) ? (X1+#Val#-#C#) : (#Val#) ))))
[G1]
Measure=Calc
Formula=(cHue1<1) ? (X1+#Val#-#C#) : ((cHue1<2) ? (#Val#) : ((cHue1<3) ? (#Val#) : ((cHue1<4) ? (X1+#Val#-#C#) : ((cHue1<5) ? (#Val#-#C#) : (#Val#-#C#) ))))
[B1]
Measure=Calc
Formula=(cHue1<1) ? (#Val#-#C#) : ((cHue1<2) ? (#Val#-#C#) : ((cHue1<3) ? (X1+#Val#-#C#) : ((cHue1<4) ? (#Val#) : ((cHue1<5) ? (#Val#) : (X1+#Val#-#C#) ))))
```

Code: Select all

```
SolidColor=#color1#
DynamicVariables=1
```