Windows Develop Bookmark and Share   
 index > Windows Forms General > Inconsistency in System.Drawing.Color?
 

Inconsistency in System.Drawing.Color?

I had a subtle bug in my code that boiled down to the fact I thought Color.Green has 255 as its green component value. It turns out that it has 128.

Isnt that counter-intuitive? Red is (255,0,0), blue is (0,0,255) but green is (0,128,0)?
For a real green it turns out that Color.Lime is the correct color to use.
Can anyone explain why this is the case?

thanks,
Jens-Christian
Jens-Christian Larsen  Tuesday, December 12, 2006 9:47 PM
The human eye is very sensitive to the wavelength of hues of green. Full intensity green (0, 255, 0) looks very bright. So bright that it deserves a name other than "Green". It is quite ugly...
nobugz  Tuesday, December 12, 2006 9:55 PM
The human eye is very sensitive to the wavelength of hues of green. Full intensity green (0, 255, 0) looks very bright. So bright that it deserves a name other than "Green". It is quite ugly...
nobugz  Tuesday, December 12, 2006 9:55 PM
Strange that .Net chooses to define this color different than most other programming/graphics platforms. I think their attempt at green is ugly :-)
It would have been nice to be able to instantiate a real green color other than than Color.Lime or the bit hard to read (0,255,0).

Anyway thanks for the answer.
Jens-Christian Larsen  Tuesday, December 12, 2006 10:13 PM

You can use google to search for other answers

Custom Search

More Threads

• Refresh time in datetimepicker control
• Dynamic Data Entry Control
• resizing of comboBox and TextBox dynamically
• .Net FrameWork
• Online/Offline ability
• [help] device manager show nothing!
• How to make an mathematical look expression in textbox or lable of Win Form
• A generic error occurred in GDI+.
• calling methods
• How can I run a method from child form?