Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is System.Drawing.Color.Green (0, 128,0)?

Tags:

c#

.net

gdi+

I thought it should be (0,255,0). Anyone know why?

like image 886
user496949 Avatar asked Dec 03 '10 03:12

user496949


1 Answers

Because the .NET framework uses the W3C version of the X11 color names. There's apparently two different "Green" colors, the X11 one which is (0, 255, 0), and the W3C one which is (0, 128, 0).

It is apparently not known why the W3C (or anybody) adopted this particular list of colors as standard, although I speculate that it's because it's the only real extensive list of "easy-to-use, human-readable" names for some RGB values (I personally can't imagine what the color #6495ED looks like until I look it up).

There are differences between the W3C and X11 list (like "Gray" and "Purple" having different RGB values between W3C and X11). Also, the .NET framework defines "DarkSeaGreen" as (143, 188, 139) instead of (143, 188, 143). I wouldn't be surprised if the rationale for these different values was "it looked more Green/Gray/Purple/etc."

like image 141
In silico Avatar answered Nov 11 '22 21:11

In silico