Color Struct
Represents a color.
public struct Color : IEquatable<Color>
Public Structure Color
Implements IEquatable(Of Color)
Implements
Remarks
We deliberately didn't use Color structure from System.Drawing or any other assembly, because we wanted to expose GemBox.Document public interface through only GemBox.Document types and .NET BCL (base class library).
Because of it, GemBox.Document can be used in a various project types, like WPF, Windows Forms, ASP.NET, WCF without a need to reference System.Drawing assembly which is a Windows Forms specific.
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
- Byte
The red component.
green
- Byte
The green component.
blue
- Byte
The blue component.
Color(Int32)
Initializes a new instance of the Color struct.
Parameters
hex
- 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
G
Gets the green component of this Color instance.
Property Value
IsEmpty
Gets a value indicating whether this Color instance is empty.
Property Value
R
Gets the red component of this Color instance.
Property Value
Methods
Equals(Color)
Parameters
other
- Color
The other color to compare with this color instance.
Returns
Equals(Object)
public override bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
Parameters
Returns
Overrides
GetHashCode()
Returns a hash code for this Color instance.
Returns
Overrides
ToString()
Returns
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
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
true if first
and second
colors are not equal; otherwise, false.