colour picker

hog

Senior Contributor
Joined
Mar 17, 2003
Messages
984
Location
UK
Does anyone know of a way to calculate a lighter/darker version of a colour selection returned from the colour picker control?

So if a user picked a shade of blue which would be the new colour of the form, then I want to set all the controls backcolor property to a different shade of the chosen colour.:)
 
If you are using Visual studio .net, you can choose colors by supplying the RGB (Red,Green,Blue) color scheme.

Red is 255,0,0
Green is 0,255,0
Blue is 0,0,255
Yellow is 255,255,0
Black is 0,0,0
White is 255,255,255

What you can do is when a user selects one of those colors change one of the three numbers by some range you choose.

If you have Adobe Photoshop you can try the colors and see their RGB values.

Hope this helps....
 
Thnx....

This is how I have done it:

Visual Basic:
Me.ColorDialog1.ShowDialog()

clrColour = Me.ColorDialog1.Color

Dim mColour As Color = Color.FromArgb(150, Me.ColorDialog1.Color)

Me.picBackground.BackColor = mColour
 
You can use ControlPaint.Dark and ControlPaint.DarkDark to calculate different shades of a colour. Or you can go the manual route by modifying the RGB or HSL values.
 
OK thnx.

What I am finding though is that when the code that changes the form backcolor and all the controls backcolor values I get a lot of flicker, but if I leave the controls alone no flicker occurs?
 
Back
Top