SpreadsheetColor Struct
Represents a spreadsheet color.
public struct SpreadsheetColor : IEquatable<SpreadsheetColor>
Public Structure SpreadsheetColor
Implements IEquatable(Of SpreadsheetColor)
Implements
Remarks
Spreadsheet color can either be empty / none, automatic, theme, standard or custom.
Empty, automatic, theme and standard colors can be created using the factory method FromName(ColorName) which accepts ColorName parameter.
System.Drawing.Color nor any other, technology-specific, color type wasn't deliberately used, because GemBox.Spreadsheet public interface is exposed only through GemBox.Spreadsheet and .NET BCL (base class library) types.
To maintain backward compatibility SpreadsheetColor implements implicit conversion operators to and from System.Drawing.Color.
Properties
B
Gets the blue component value of this SpreadsheetColor structure.
Property Value
- System.Byte
The blue component value of this SpreadsheetColor structure.
G
Gets the green component value of this SpreadsheetColor structure.
Property Value
- System.Byte
The green component value of this SpreadsheetColor structure.
IsEmpty
Specifies whether this SpreadsheetColor structure is uninitialized.
Property Value
- System.Boolean
true if this SpreadsheetColor structure is uninitialized; otherwise, false.
R
Gets the red component value of this SpreadsheetColor structure.
Property Value
- System.Byte
The red component value of this SpreadsheetColor structure.
Methods
Equals(SpreadsheetColor)
Determines whether the other
SpreadsheetColor is equal to this SpreadsheetColor instance.
public bool Equals(SpreadsheetColor other)
Public Function Equals(other As SpreadsheetColor) As Boolean
Parameters
other
- SpreadsheetColor
The other SpreadsheetColor to compare with this SpreadsheetColor instance.
Returns
- System.Boolean
true if the other
SpreadsheetColor is equal to this SpreadsheetColor instance; otherwise, false.
Equals(Object)
Determines whether the specified System.Object is equal to this SpreadsheetColor 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 SpreadsheetColor instance.
Returns
- System.Boolean
true if the specified System.Object is a SpreadsheetColor and is equal to this SpreadsheetColor instance; otherwise, false.
Overrides
FromArgb(Int32)
Creates a SpreadsheetColor structure from a 32-bit ARGB value.
public static SpreadsheetColor FromArgb(int argb)
Public Shared Function FromArgb(argb As Integer) As SpreadsheetColor
Parameters
argb
- System.Int32
A value specifying the 32-bit ARGB value.
Returns
A SpreadsheetColor structure with the specified value.
FromArgb(Int32, Int32, Int32)
Creates a SpreadsheetColor structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits.
public static SpreadsheetColor FromArgb(int red, int green, int blue)
Public Shared Function FromArgb(red As Integer, green As Integer, blue As Integer) As SpreadsheetColor
Parameters
red
- System.Int32
The red component value for the new SpreadsheetColor. Valid values are 0 through 255.
green
- System.Int32
The green component value for the new SpreadsheetColor. Valid values are 0 through 255.
blue
- System.Int32
The blue component value for the new SpreadsheetColor. Valid values are 0 through 255.
Returns
A SpreadsheetColor structure with the specified values.
Exceptions
- System.ArgumentOutOfRangeException
Parameter red
, green
, or blue
is less than 0 or greater than 255.
FromName(ColorName)
Creates a SpreadsheetColor structure from the specified predefined color.
public static SpreadsheetColor FromName(ColorName name)
Public Shared Function FromName(name As ColorName) As SpreadsheetColor
Parameters
Returns
A SpreadsheetColor structure with the specified value.
GetHashCode()
Returns a hash code for this SpreadsheetColor instance.
Returns
- System.Int32
An integer value that specifies a hash value for this SpreadsheetColor instance.
Overrides
ToArgb()
Gets the 32-bit ARGB value of this SpreadsheetColor structure.
Returns
- System.Int32
The 32-bit ARGB value of this SpreadsheetColor.
ToString()
Returns a System.String that represents this SpreadsheetColor instance.
Returns
- System.String
A System.String that represents this SpreadsheetColor instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
Operators
Equality(SpreadsheetColor, SpreadsheetColor)
Determines whether first
and second
SpreadsheetColors are equal.
public static bool operator ==(SpreadsheetColor first, SpreadsheetColor second)
Public Shared Operator =(first As SpreadsheetColor, second As SpreadsheetColor) As Boolean
Parameters
first
- SpreadsheetColor
The first SpreadsheetColor.
second
- SpreadsheetColor
The second SpreadsheetColor.
Returns
- System.Boolean
true if first
and second
SpreadsheetColors are equal; otherwise, false.
Implicit(SpreadsheetColor to Color)
Performs an implicit conversion from SpreadsheetColor to GemBox.Drawing.Color.
public static implicit operator Color(SpreadsheetColor color)
Public Shared Widening Operator CType(color As SpreadsheetColor) As Color
Parameters
color
- SpreadsheetColor
The input SpreadsheetColor.
Returns
- System.Drawing.Color
The output GemBox.Drawing.Color which is the result of the conversion.
Implicit(Color to SpreadsheetColor)
Performs an implicit conversion from GemBox.Drawing.Color to SpreadsheetColor.
public static implicit operator SpreadsheetColor(Color color)
Public Shared Widening Operator CType(color As Color) As SpreadsheetColor
Parameters
color
- System.Drawing.Color
The input GemBox.Drawing.Color color.
Returns
The output SpreadsheetColor which is the result of the conversion.
Inequality(SpreadsheetColor, SpreadsheetColor)
Determines whether first
and second
SpreadsheetColors are not equal.
public static bool operator !=(SpreadsheetColor first, SpreadsheetColor second)
Public Shared Operator <>(first As SpreadsheetColor, second As SpreadsheetColor) As Boolean
Parameters
first
- SpreadsheetColor
The first SpreadsheetColor.
second
- SpreadsheetColor
The second SpreadsheetColor.
Returns
- System.Boolean
true if first
and second
SpreadsheetColors are not equal; otherwise, false.