Color Struct
Represents a color.
public struct Color : IEquatable<Color>
Public Structure Color
Implements IEquatable(Of Color)
Implements
Constructors
Color(Byte, Byte, Byte)
Initializes a new instance of the Color struct.
public Color(byte red, byte green, byte blue)
Public Sub New(red As Byte, green As Byte, blue As Byte)
Parameters
red
- System.Byte
The red component.
green
- System.Byte
The green component.
blue
- System.Byte
The blue component.
Color(Int32)
Initializes a new instance of the Color struct.
Parameters
hex
- System.Int32
The integer that represents the color in the format [__,RR,GG,BB] where RR is the byte that represents the red component, GG is the byte that represents the green component and BB is the byte that represents the blue component.
Fields
Black
Represents a black color (RGB = 0x000000).
Field Value
Blue
Represents a blue color (RGB = 0x0000FF).
Field Value
Brown
Represents a brown color (RGB = 0xA52A2A).
Field Value
Cyan
Represents a cyan color (RGB = 0x00FFFF).
Field Value
DarkBlue
Represents a dark blue color (RGB = 0x000080).
Field Value
DarkCyan
Represents a dark cyan color (RGB = 0x008080).
Field Value
DarkGray
Represents a dark gray color (RGB = 0x808080).
Field Value
DarkGreen
Represents a dark green color (RGB = 0x008000).
Field Value
DarkMagenta
Represents a dark magenta color (RGB = 0x800080).
Field Value
DarkRed
Represents a dark red color (RGB = 0x800000).
Field Value
DarkYellow
Represents a dark yellow color (RGB = 0x808000).
Field Value
Empty
Represents an empty color (RGB = 0x000000).
Field Value
Gray
Represents a gray color (RGB = 0x808080).
Field Value
Green
Represents a green color (RGB = 0x00FF00).
Field Value
LightGray
Represents a light gray color (RGB = 0xC0C0C0).
Field Value
Magenta
Represents a magenta color (RGB = 0xFF00FF).
Field Value
Orange
Represents an orange color (RGB = 0xFFA500).
Field Value
Pink
Represents a pink color (RGB = 0xFFC0CB).
Field Value
Purple
Represents a purple color (RGB = 0x800080).
Field Value
Red
Represents a red color (RGB = 0xFF0000).
Field Value
White
Represents a write color (RGB = 0xFFFFFF).
Field Value
Yellow
Represents a yellow color (RGB = 0xFFFF00).
Field Value
Properties
B
Gets the blue component of this Color instance.
Property Value
- System.Byte
The blue component of this Color instance.
G
Gets the green component of this Color instance.
Property Value
- System.Byte
The green component of this Color instance.
IsEmpty
Gets a value indicating whether this Color instance is empty.
Property Value
- System.Boolean
true if this Color instance is empty; otherwise, false.
R
Gets the red component of this Color instance.
Property Value
- System.Byte
The red component of this Color instance.
Methods
Equals(Color)
Parameters
other
- Color
The other color to compare with this color instance.
Returns
Equals(Object)
Determines whether the specified System.Object is equal to this Color instance.
public override bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
Parameters
obj
- System.Object
The System.Object to compare with this color instance.
Returns
- System.Boolean
Overrides
GetHashCode()
Returns a hash code for this Color instance.
Returns
- System.Int32
An integer value that specifies a hash value for this Color instance.
Overrides
ToString()
Returns a System.String that represents this Color instance.
Returns
- System.String
A System.String that represents this Color instance.
Overrides
Operators
Equality(Color, Color)
Determines whether first
and second
Colors are equal.
public static bool operator ==(Color first, Color second)
Public Shared Operator =(first As Color, second As Color) As Boolean
Parameters
first
- Color
The first color.
second
- Color
The second color.
Returns
- System.Boolean
true if first
and second
colors are equal; otherwise, false.
Inequality(Color, Color)
Determines whether first
and second
Colors are not equal.
public static bool operator !=(Color first, Color second)
Public Shared Operator <>(first As Color, second As Color) As Boolean
Parameters
first
- Color
The first color.
second
- Color
The second color.
Returns
- System.Boolean
true if first
and second
colors are not equal; otherwise, false.