Sunday, December 07, 2008

Creating a color list

While setting up an ASP.Net Pie Chart Control, I wanted to create some sets of colors for subcategories within the chart.

To do this, I tried code like:

private List PieChartColorList(Color baseColor)
List list = new List();
for (int i = 0; i < 5; i++)
list.Add(System.Windows.Forms.ControlPaint.Dark(baseColor, 0.25F - i * 0.05F));
list.Add(System.Windows.Forms.ControlPaint.Light(baseColor, 0.25F- i * 0.05F));
return list;

using the ControlPaint tip from ( - but it didn't work very well....

No comments:

Post a Comment