Something
public text v1 · immutablealias rainbowcolor {
var %x
var %y, %i = 1
var %clist = 02,03,0405,06,07,09,10,11,12,13
while (%i <= $len($1)) {
if (%i >= $numtok(%clist,44)) {
var %ii = $calc($numtok(%clist,44) - %i)
set %y $gettok(%clist,%ii,44)
}
else {
set %y $gettok(%clist,%i,44)
}
set %x $+(%x,%y,$mid($1,%i,1))
inc %i
}
if ($isid) { return %x }
else { echo -a %x }
}