CyclePalette(id, start, end[, repeat])
start and the pen specified by end.
If end is greater than start, all pens starting at the index start will be shifted to the right and wrap
at the pen specified by end. If start is greater than end, pens will be cycled in reverse, i.e. they
will be shifted to the left, wrapping at the pen index specified by start. The repeat argument can be used
to specify how many times the cycling should be repeated. This defaults to 1 which means that colors should
only be cycled once.
@DISPLAY {Palette = #PALETTE_CGA}
SetFont(#SANS, 96)
SetPaletteMode(#PALETTEMODE_PEN)
t$ = "Hollywood"
For Local k = 0 To StrLen(t$) - 1
SetDrawPen(k + 2)
Print(MidStr(t$, k, 1))
Next
ExtractPalette(1, #BGPIC, 1)
StartTimer(1)
Repeat
CyclePalette(1, 2, 10)
SetPalette(1)
WaitTimer(1, 80)
Forever
The code above prints the individual of characters of the string "Hollywood"
in different colors and then cycles their colors.