Public Structure Color
Public Shared Red As New Color(&HFF)
Public Shared Green As New Color(&HFF00)
Public Shared Blue As New Color(&HFF0000)
Public Shared Black As New Color(&H0)
Public Shared White As New Color(&HFFFFFF)
Public Sub New(rgb As Integer)
' Insert code here.
End Sub
Public Sub New(r As Byte, g As Byte, b As Byte)
' Insert code here.
End Sub
Public ReadOnly Property RedValue() As Byte
Get
Return Color
End Get
End Property
Public ReadOnly Property GreenValue() As Byte
Get
Return Color
End Get
End Property
Public ReadOnly Property BlueValue() As Byte
Get
Return Color
End Get
End Property
End Structure
[C#]
public struct Color
{
public static readonly Color Red = new Color(0x0000FF);
public static readonly Color Green = new Color(0x00FF00);
public static readonly Color Blue = new Color(0xFF0000);
public static readonly Color Black = new Color(0x000000);
public static readonly Color White = new Color(0xFFFFFF);
public Color(int rgb)
{ // Insert code here.}
public Color(byte r, byte g, byte b)
{ // Insert code here.}
public byte RedValue
{
get
{
return Color;
}
}
public byte GreenValue
{
get
{
return Color;
}
}
public byte BlueValue
{
get
{
return Color;
}
}
}