This code sample will produce a box and a dot which cycle through all the colours in the colour spectrum:
lcolourlimit = 255
do
Select lightstage
Case 0
rlight = lcolourlimit
glight = 0
blight = blight+1
If blight = lcolourlimit then lightstage = 1
EndCase
Case 1
rlight = rlight-1
If rlight = 0 then lightstage = 2
EndCase
Case 2
glight = glight+1
If glight = lcolourlimit then lightstage = 3
EndCase
Case 3
blight = blight-1
If blight = 0 then lightstage = 4
EndCase
Case 4
rlight = rlight+1
If rlight = lcolourlimit then lightstage = 5
EndCase
Case 5
glight = glight-1
If glight = 0 then lightstage = 0
EndCase
Endselect
box 0,0,100,100,RGB(rlight,glight,blight),RGB(rlight,glight,blight),RGB(rlight,glight,blight),RGB(rlight,glight,blight)
dot 200,200,RGB(rlight,glight,blight)
sync
loop
It cycles to produce red, green and blue colour components and then uses the RGB command to convert those into a colour value (which is 4 bytes). The INK RGB command is quite slow, so avoid it where possible.