hog Posted June 19, 2003 Posted June 19, 2003 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.:) Quote My website
Mehyar Posted June 19, 2003 Posted June 19, 2003 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.... Quote Dream as if you'll live forever, live as if you'll die today
hog Posted June 19, 2003 Author Posted June 19, 2003 Thnx.... This is how I have done it: Me.ColorDialog1.ShowDialog() clrColour = Me.ColorDialog1.Color Dim mColour As Color = Color.FromArgb(150, Me.ColorDialog1.Color) Me.picBackground.BackColor = mColour Quote My website
*Gurus* divil Posted June 19, 2003 *Gurus* Posted June 19, 2003 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. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
hog Posted June 20, 2003 Author Posted June 20, 2003 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? Quote My website
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.