GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    SpreadsheetColor Struct

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a spreadsheet color.

    • C#
    • VB.NET
    public struct SpreadsheetColor : IEquatable<SpreadsheetColor>
    Public Structure SpreadsheetColor
        Implements IEquatable(Of SpreadsheetColor)
    Implements
    System.IEquatable<SpreadsheetColor>
    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.

    • C#
    • VB.NET
    public readonly byte B { get; }
    Public ReadOnly Property B As Byte
    Property Value
    System.Byte

    The blue component value of this SpreadsheetColor structure.

    G

    Gets the green component value of this SpreadsheetColor structure.

    • C#
    • VB.NET
    public readonly byte G { get; }
    Public ReadOnly Property G As Byte
    Property Value
    System.Byte

    The green component value of this SpreadsheetColor structure.

    IsEmpty

    Specifies whether this SpreadsheetColor structure is uninitialized.

    • C#
    • VB.NET
    public readonly bool IsEmpty { get; }
    Public ReadOnly Property IsEmpty As Boolean
    Property Value
    System.Boolean

    true if this SpreadsheetColor structure is uninitialized; otherwise, false.

    R

    Gets the red component value of this SpreadsheetColor structure.

    • C#
    • VB.NET
    public readonly byte R { get; }
    Public ReadOnly Property R As Byte
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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
    System.ValueType.Equals(System.Object)

    FromArgb(Int32)

    Creates a SpreadsheetColor structure from a 32-bit ARGB value.

    • C#
    • VB.NET
    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
    SpreadsheetColor

    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.

    • C#
    • VB.NET
    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
    SpreadsheetColor

    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.

    • C#
    • VB.NET
    public static SpreadsheetColor FromName(ColorName name)
    Public Shared Function FromName(name As ColorName) As SpreadsheetColor
    Parameters
    name
    ColorName

    An element of the ColorName enumeration.

    Returns
    SpreadsheetColor

    A SpreadsheetColor structure with the specified value.

    GetHashCode()

    Returns a hash code for this SpreadsheetColor instance.

    • C#
    • VB.NET
    public override int GetHashCode()
    Public Overrides Function GetHashCode As Integer
    Returns
    System.Int32

    An integer value that specifies a hash value for this SpreadsheetColor instance.

    Overrides
    System.ValueType.GetHashCode()

    ToArgb()

    Gets the 32-bit ARGB value of this SpreadsheetColor structure.

    • C#
    • VB.NET
    public int ToArgb()
    Public Function ToArgb As Integer
    Returns
    System.Int32

    The 32-bit ARGB value of this SpreadsheetColor.

    ToString()

    Returns a System.String that represents this SpreadsheetColor instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this SpreadsheetColor instance.

    Overrides
    System.ValueType.ToString()
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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
    SpreadsheetColor

    The output SpreadsheetColor which is the result of the conversion.

    Inequality(SpreadsheetColor, SpreadsheetColor)

    Determines whether first and second SpreadsheetColors are not equal.

    • C#
    • VB.NET
    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.

    Implements

    System.IEquatable<T>

    See Also

    Color
    LineColor
    PatternForegroundColor
    PatternBackgroundColor
    GradientColor1
    GradientColor2
    TabColor
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.