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

    Show / Hide Table of Contents

    DrawingColor Struct

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

    Represents a color.

    • C#
    • VB.NET
    public struct DrawingColor : IEquatable<DrawingColor>
    Public Structure DrawingColor
        Implements IEquatable(Of DrawingColor)
    Implements
    System.IEquatable<DrawingColor>

    Properties

    A

    Gets the color opacity (0 = fully transparent, 255 = fully opaque).

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

    The color opacity.

    Argb

    Gets the Opacity, Red, Green and Blue components in a single System.Int32 value.

    • C#
    • VB.NET
    public readonly int Argb { get; }
    Public ReadOnly Property Argb As Integer
    Property Value
    System.Int32

    The Opacity, Red, Green and Blue components in a single System.Int32 value.

    B

    Gets the Blue component (from 0 to 255).

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

    The Blue component.

    G

    Gets the Green component (from 0 to 255).

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

    The Green component.

    Name

    Gets the color name.

    • C#
    • VB.NET
    public readonly DrawingColorName Name { get; }
    Public ReadOnly Property Name As DrawingColorName
    Property Value
    DrawingColorName

    The color name.

    R

    Gets the Red component (from 0 to 255).

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

    The Red component.

    Methods

    Equals(DrawingColor)

    Determines whether the other DrawingColor is equal to this DrawingColor instance.

    • C#
    • VB.NET
    public bool Equals(DrawingColor other)
    Public Function Equals(other As DrawingColor) As Boolean
    Parameters
    other
    DrawingColor

    The other color to compare with this color instance.

    Returns
    System.Boolean

    true if the other DrawingColor is equal to this DrawingColor instance; otherwise, false.

    Equals(Object)

    Determines whether the specified System.Object is equal to this DrawingColor 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 color instance.

    Returns
    System.Boolean

    true if the specified System.Object is a DrawingColor and is equal to this DrawingColor instance; otherwise, false.

    Overrides
    System.ValueType.Equals(System.Object)

    FromHsl(Int32, Int32, Int32)

    Creates a new color instance from the specified Hue, Saturation and Lightness components.

    • C#
    • VB.NET
    public static DrawingColor FromHsl(int h, int s, int l)
    Public Shared Function FromHsl(h As Integer, s As Integer, l As Integer) As DrawingColor
    Parameters
    h
    System.Int32

    The Hue component (from 0 to 255).

    s
    System.Int32

    The Saturation component (from 0 to 255).

    l
    System.Int32

    The Lightness component (from 0 to 255).

    Returns
    DrawingColor

    A new color instance from the specified Hue, Saturation and Lightness components.

    FromHsl(Int32, Int32, Int32, Double)

    Creates a new color instance from the specified Hue, Saturation and Lightness components and transparency.

    • C#
    • VB.NET
    public static DrawingColor FromHsl(int h, int s, int l, double transparency)
    Public Shared Function FromHsl(h As Integer, s As Integer, l As Integer, transparency As Double) As DrawingColor
    Parameters
    h
    System.Int32

    The Hue component (from 0 to 255).

    s
    System.Int32

    The Saturation component (from 0 to 255).

    l
    System.Int32

    The Lightness component (from 0 to 255).

    transparency
    System.Double

    The transparency (0 = fully opaque, 1 = fully transparent).

    Returns
    DrawingColor

    A new color instance from the specified Hue, Saturation and Lightness components and transparency.

    FromName(DrawingColorName)

    Creates a new color instance from the specified color name.

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

    The color name.

    Returns
    DrawingColor

    A color instance with the specified name.

    FromName(DrawingColorName, Double)

    Creates a new color instance from the specified color name and luminance.

    • C#
    • VB.NET
    public static DrawingColor FromName(DrawingColorName name, double luminance)
    Public Shared Function FromName(name As DrawingColorName, luminance As Double) As DrawingColor
    Parameters
    name
    DrawingColorName

    The color name.

    luminance
    System.Double

    The luminance (-1 = darkest, 0 = none, 1 = lightest).

    Returns
    DrawingColor

    A color instance with the specified name and luminance.

    FromName(DrawingColorName, Double, Double)

    Creates a new color instance from the specified color name, luminance and transparency.

    • C#
    • VB.NET
    public static DrawingColor FromName(DrawingColorName name, double luminance, double transparency)
    Public Shared Function FromName(name As DrawingColorName, luminance As Double, transparency As Double) As DrawingColor
    Parameters
    name
    DrawingColorName

    The color name.

    luminance
    System.Double

    The luminance (-1 = darkest, 0 = none, 1 = lightest).

    transparency
    System.Double

    The transparency (0 = fully opaque, 1 = fully transparent).

    Returns
    DrawingColor

    A color instance with the specified name, luminance and transparency.

    FromRgb(Int32, Int32, Int32)

    Creates a new color instance from the specified Red, Green and Blue components.

    • C#
    • VB.NET
    public static DrawingColor FromRgb(int r, int g, int b)
    Public Shared Function FromRgb(r As Integer, g As Integer, b As Integer) As DrawingColor
    Parameters
    r
    System.Int32

    The Red component (from 0 to 255).

    g
    System.Int32

    The Green component (from 0 to 255).

    b
    System.Int32

    The Blue component (from 0 to 255).

    Returns
    DrawingColor

    A new color instance from the specified Red, Green and Blue components.

    FromRgb(Int32, Int32, Int32, Double)

    Creates a new color instance from the specified Red, Green and Blue components and transparency.

    • C#
    • VB.NET
    public static DrawingColor FromRgb(int r, int g, int b, double transparency)
    Public Shared Function FromRgb(r As Integer, g As Integer, b As Integer, transparency As Double) As DrawingColor
    Parameters
    r
    System.Int32

    The Red component (from 0 to 255).

    g
    System.Int32

    The Green component (from 0 to 255).

    b
    System.Int32

    The Blue component (from 0 to 255).

    transparency
    System.Double

    The transparency (0 = fully opaque, 1 = fully transparent).

    Returns
    DrawingColor

    A new color instance from the specified Red, Green and Blue components and transparency.

    GetHashCode()

    Returns a hash code for this DrawingColor 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 DrawingColor instance.

    Overrides
    System.ValueType.GetHashCode()

    ToString()

    Returns a System.String that represents this DrawingColor instance.

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

    A System.String that represents this DrawingColor instance.

    Overrides
    System.ValueType.ToString()

    Operators

    Equality(DrawingColor, DrawingColor)

    Determines whether first and second DrawingColors are equal.

    • C#
    • VB.NET
    public static bool operator ==(DrawingColor first, DrawingColor second)
    Public Shared Operator =(first As DrawingColor, second As DrawingColor) As Boolean
    Parameters
    first
    DrawingColor

    The first color.

    second
    DrawingColor

    The second color.

    Returns
    System.Boolean

    true if first and second colors are equal; otherwise, false.

    Inequality(DrawingColor, DrawingColor)

    Determines whether first and second DrawingColors are not equal.

    • C#
    • VB.NET
    public static bool operator !=(DrawingColor first, DrawingColor second)
    Public Shared Operator <>(first As DrawingColor, second As DrawingColor) As Boolean
    Parameters
    first
    DrawingColor

    The first color.

    second
    DrawingColor

    The second color.

    Returns
    System.Boolean

    true if first and second colors are not equal; otherwise, false.

    Implements

    System.IEquatable<T>
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.