Pastel Colors?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I'm trying to set the background color of a datagrid cell into a pastel color.

I can change this into other colors in the grid_ItemDataBound event thus:
e.Item.Cells(3).BackColor = System.Drawing.Color.Green
or
e.Item.Cells(3).BackColor = System.Drawing.Color.Red
(dependent on particular values in some of the columns) but these seem
pretty garish to me.

How can I set these to non-standard colors - in a variety of pastel shades?
Hopefully knowing how I can set these colors without relying on
System.Drawing.Color.(something) will be enough to get me on my way.

Many thanks!
 
Define new color object

System.Drawing.Color newColor = new System.Drawing.Color();

Assign it RGB values or ARGB

newColor = System.Drawing.Color.FromArgb(int red, int green, int blue)
 
I belive you can also assign non-standard colors via the property window by
directly entering rgb comma separated values: 255,255,255
 
Back
Top