in reply to how can you put this?
$graph->set(dclrs => \@colour_array)
or:
$graph->set(dclrs => [@colour_array])
There's a slight difference between the two; the first gives $graph a reference to your original array, so $graph could theoretically modify it (push elements onto it, for example). The second creates an empty array, copies from your original array into the new one, and gives $graph a reference to the new array. That way your original array is safe from any modification.
Which one you choose depends on whether you want to allow $graph to be able to modify @colour_array at all. If you don't care whether it does, then use the first as it will be very marginally faster.
|
|---|