[2.0] How do the default colors work?
Sorry, but if I don't ask this, it is going to drive me nuts.
I found myself today looking at System.Drawing.Color and looked at the default colors and followed them a bit but I don't get how they are resolved.
Color.AliceBlue
csharp Code:
public static Color AliceBlue
{
get
{
return new Color(KnownColor.AliceBlue);
}
}
Color(KnownColor)
csharp Code:
internal Color(KnownColor knownColor)
{
this.value = 0x0L;
this.state = StateKnownColorValid;
this.name = null;
this.knownColor = (short) knownColor;
}
Where does it resolve what the known colors value is?
I checked Color.A to see if when you access it, it resolves it, But it doesn't...
csharp Code:
public byte A
{
get
{
return (byte) ((this.Value >> 0x18) & 0xffL);
}
}
Where is the known color resolved?
Re: [2.0] How do the default colors work?
KnownColor is an enumeration. The Color structure simply uses a switch statement or the like to create Color values from KnownColor values.
Re: [2.0] How do the default colors work?
Quote:
Originally Posted by jmcilhinney
KnownColor is an enumeration. The Color structure simply uses a switch statement or the like to create Color values from KnownColor values.
But where? I followed the Get{} for White and it didn't lead me to a switch or anything.