You have to do something like this: Code: global proc vector[] myFireworksColors( int $numColors ) { int $i; vector $vMyColorArray[]; float $r, $g, $b; for($i = 0; $i < $numColors; $i++) { $r = rand(0, 1); $g = rand(0, 1); $b = rand(0, 1); $vMyColorArray[$i] = << $r, $g, $b >>; } return $vMyColorArray; } Hope I didn't make too many typos since I didn't tested it