Help generating random colours

g_r_a_robinson

Regular
Joined
Jan 13, 2004
Messages
71
Hi there.

I have a dilema in which I am passing an unknown amount of values into my chart.cs class that produce the bar graph. Problem is that the chart class only includes 12 colours, if I exceed this my graph is not displayed. What I figured I would need to do is somehow use an arraylist to load the amount of colours randomly in accordance with amount of values being passed to the class.

Heres the section that provides an array of specified colours :

<code>
abstract public class Chart
{
private const int _colorLimit = 12;

private Color[] _color =
{
Color.Chocolate,
Color.YellowGreen,
Color.Olive,
Color.DarkKhaki,
Color.Sienna,
Color.PaleGoldenrod,
Color.Peru,
Color.Tan,
Color.Khaki,
Color.DarkGoldenrod,
Color.Maroon,
Color.OliveDrab
};

</code>

I'm still quite a beginner with most of these things. Any help would be appreciated.
 
Back
Top