|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Complementary colors?Hello, Group,
If drawing on a control, it would be desirable to select a colour that significantly differs from the control's background colour. Is there a standard (or preferred) way to programmatically select a complementary color at run time? Thanks in advance for any suggestions. Cheers, Randy I would use the GetBrightness method on the color to determine if it's
closer to black or write, and use the other. The complementary color could be calculated using: Color.FromArgb(theColor.ToArgb() xor 0x00ffffff) That doesn't work for all colors, though. The complementary color for 50% gray is 50% gray... R. MacDonald wrote: Show quoteHide quote > Hello, Group, > > If drawing on a control, it would be desirable to select a colour that > significantly differs from the control's background colour. Is there a > standard (or preferred) way to programmatically select a complementary > color at run time? > > Thanks in advance for any suggestions. > > Cheers, > Randy Hello, Göran,
Thanks for the suggestion about GetBrightness. Looking at this I see that there are also GetHue and GetSaturation methods that I might be able to apply to this requirement. Cheers, Randy Göran Andersson wrote: Show quoteHide quote > I would use the GetBrightness method on the color to determine if it's > closer to black or write, and use the other. > > The complementary color could be calculated using: > > Color.FromArgb(theColor.ToArgb() xor 0x00ffffff) > > That doesn't work for all colors, though. The complementary color for > 50% gray is 50% gray... > > R. MacDonald wrote: > >> Hello, Group, >> >> If drawing on a control, it would be desirable to select a colour that >> significantly differs from the control's background colour. Is there >> a standard (or preferred) way to programmatically select a >> complementary color at run time? >> >> Thanks in advance for any suggestions. >> >> Cheers, >> Randy
Undefined function 'InStrRev' in expression.
Is this Possible ? The big Debate on DoEvents Array Problems - still cant get something set up right. Dll fails to register Click and Double click events are not fired in listview component in VB.NET How can I get Windows user, password and domain? Reading XML file getting error How to override only Get or only Set? where shoule store the questions and answers |
|||||||||||||||||||||||