Search Results for

    Show / Hide Table of Contents

    Class Color

    A universally compatible Color for .NET 7, .NET 6, .NET 5, and .NET Core. As well as compatiblity with Windows, NanoServer, IIS, macOS, Mobile, Xamarin, iOS, Android, Google Compute, Azure, AWS, and Linux.

    Works nicely with popular Image Color such as System.Drawing.Color, SkiaSharp.SKColor, SixLabors.ImageSharp.Color, Microsoft.Maui.Graphics.Color.

    Implicit casting means that using this class to input and output Color from public APIs gives full compatibility to all Color-types fully supported by Microsoft.

    Inheritance
    System.Object
    Color
    Namespace: IronSoftware.Drawing
    Assembly: IronSoftware.Drawing.Common.dll
    Syntax
    public class Color : Object

    Constructors

    Color(Int32, Int32, Int32)

    Construct a new Color.

    Further Documentation:
    Code Example

    Declaration
    public Color(int red, int green, int blue)
    Parameters
    Type Name Description
    System.Int32 red

    The red component. Valid values are 0 through 255.

    System.Int32 green

    The green component. Valid values are 0 through 255.

    System.Int32 blue

    The blue component. Valid values are 0 through 255.

    Color(Int32, Int32, Int32, Int32)

    Construct a new Color.

    Further Documentation:
    Code Example

    Declaration
    public Color(int alpha, int red, int green, int blue)
    Parameters
    Type Name Description
    System.Int32 alpha

    The alpha component. Valid values are 0 through 255.

    System.Int32 red

    The red component. Valid values are 0 through 255.

    System.Int32 green

    The green component. Valid values are 0 through 255.

    System.Int32 blue

    The blue component. Valid values are 0 through 255.

    Color(String)

    Construct a new Color.

    Further Documentation:
    Code Example

    Declaration
    public Color(string colorcode)
    Parameters
    Type Name Description
    System.String colorcode

    The hexadecimal representation of the combined color components arranged in rgb, argb, rrggbb, or aarrggbb format to match web syntax.

    Fields

    AliceBlue

    Gets a system-defined color that has an ARGB value of #F0F8FF.

    Declaration
    public static Color AliceBlue
    Field Value
    Type Description
    Color

    AntiqueWhite

    Gets a system-defined color that has an ARGB value of #FAEBD7.

    Declaration
    public static Color AntiqueWhite
    Field Value
    Type Description
    Color

    Aqua

    Gets a system-defined color that has an ARGB value of #00FFFF.

    Declaration
    public static Color Aqua
    Field Value
    Type Description
    Color

    Aquamarine

    Gets a system-defined color that has an ARGB value of #7FFFD4.

    Declaration
    public static Color Aquamarine
    Field Value
    Type Description
    Color

    Azure

    Gets a system-defined color that has an ARGB value of #F0FFFF.

    Declaration
    public static Color Azure
    Field Value
    Type Description
    Color

    Beige

    Gets a system-defined color that has an ARGB value of #F5F5DC.

    Declaration
    public static Color Beige
    Field Value
    Type Description
    Color

    Bisque

    Gets a system-defined color that has an ARGB value of #FFE4C4.

    Declaration
    public static Color Bisque
    Field Value
    Type Description
    Color

    Black

    Gets a system-defined color that has an ARGB value of #000000.

    Declaration
    public static Color Black
    Field Value
    Type Description
    Color

    BlanchedAlmond

    Gets a system-defined color that has an ARGB value of #FFEBCD.

    Declaration
    public static Color BlanchedAlmond
    Field Value
    Type Description
    Color

    Blue

    Gets a system-defined color that has an ARGB value of #0000FF.

    Declaration
    public static Color Blue
    Field Value
    Type Description
    Color

    BlueViolet

    Gets a system-defined color that has an ARGB value of #8A2BE2.

    Declaration
    public static Color BlueViolet
    Field Value
    Type Description
    Color

    Brown

    Gets a system-defined color that has an ARGB value of #A52A2A.

    Declaration
    public static Color Brown
    Field Value
    Type Description
    Color

    BurlyWood

    Gets a system-defined color that has an ARGB value of #DEB887.

    Declaration
    public static Color BurlyWood
    Field Value
    Type Description
    Color

    CadetBlue

    Gets a system-defined color that has an ARGB value of #5F9EA0.

    Declaration
    public static Color CadetBlue
    Field Value
    Type Description
    Color

    Chartreuse

    Gets a system-defined color that has an ARGB value of #7FFF00.

    Declaration
    public static Color Chartreuse
    Field Value
    Type Description
    Color

    Chocolate

    Gets a system-defined color that has an ARGB value of #D2691E.

    Declaration
    public static Color Chocolate
    Field Value
    Type Description
    Color

    Coral

    Gets a system-defined color that has an ARGB value of #FF7F50.

    Declaration
    public static Color Coral
    Field Value
    Type Description
    Color

    CornflowerBlue

    Gets a system-defined color that has an ARGB value of #6495ED.

    Declaration
    public static Color CornflowerBlue
    Field Value
    Type Description
    Color

    Cornsilk

    Gets a system-defined color that has an ARGB value of #FFF8DC.

    Declaration
    public static Color Cornsilk
    Field Value
    Type Description
    Color

    Crimson

    Gets a system-defined color that has an ARGB value of #DC143C.

    Declaration
    public static Color Crimson
    Field Value
    Type Description
    Color

    Cyan

    Gets a system-defined color that has an ARGB value of #00FFFF.

    Declaration
    public static Color Cyan
    Field Value
    Type Description
    Color

    DarkBlue

    Gets a system-defined color that has an ARGB value of #00008B.

    Declaration
    public static Color DarkBlue
    Field Value
    Type Description
    Color

    DarkCyan

    Gets a system-defined color that has an ARGB value of #008B8B.

    Declaration
    public static Color DarkCyan
    Field Value
    Type Description
    Color

    DarkGoldenrod

    Gets a system-defined color that has an ARGB value of #B8860B.

    Declaration
    public static Color DarkGoldenrod
    Field Value
    Type Description
    Color

    DarkGray

    Gets a system-defined color that has an ARGB value of #A9A9A9.

    Declaration
    public static Color DarkGray
    Field Value
    Type Description
    Color

    DarkGreen

    Gets a system-defined color that has an ARGB value of #006400.

    Declaration
    public static Color DarkGreen
    Field Value
    Type Description
    Color

    DarkKhaki

    Gets a system-defined color that has an ARGB value of #BDB76B.

    Declaration
    public static Color DarkKhaki
    Field Value
    Type Description
    Color

    DarkMagenta

    Gets a system-defined color that has an ARGB value of #8B008B.

    Declaration
    public static Color DarkMagenta
    Field Value
    Type Description
    Color

    DarkOliveGreen

    Gets a system-defined color that has an ARGB value of #556B2F.

    Declaration
    public static Color DarkOliveGreen
    Field Value
    Type Description
    Color

    DarkOrange

    Gets a system-defined color that has an ARGB value of #FF8C00.

    Declaration
    public static Color DarkOrange
    Field Value
    Type Description
    Color

    DarkOrchid

    Gets a system-defined color that has an ARGB value of #9932CC.

    Declaration
    public static Color DarkOrchid
    Field Value
    Type Description
    Color

    DarkRed

    Gets a system-defined color that has an ARGB value of #8B0000.

    Declaration
    public static Color DarkRed
    Field Value
    Type Description
    Color

    DarkSalmon

    Gets a system-defined color that has an ARGB value of #E9967A.

    Declaration
    public static Color DarkSalmon
    Field Value
    Type Description
    Color

    DarkSeaGreen

    Gets a system-defined color that has an ARGB value of #8FBC8B.

    Declaration
    public static Color DarkSeaGreen
    Field Value
    Type Description
    Color

    DarkSlateBlue

    Gets a system-defined color that has an ARGB value of #483D8B.

    Declaration
    public static Color DarkSlateBlue
    Field Value
    Type Description
    Color

    DarkSlateGray

    Gets a system-defined color that has an ARGB value of #2F4F4F.

    Declaration
    public static Color DarkSlateGray
    Field Value
    Type Description
    Color

    DarkTurquoise

    Gets a system-defined color that has an ARGB value of #00CED1.

    Declaration
    public static Color DarkTurquoise
    Field Value
    Type Description
    Color

    DarkViolet

    Gets a system-defined color that has an ARGB value of #9400D3.

    Declaration
    public static Color DarkViolet
    Field Value
    Type Description
    Color

    DeepPink

    Gets a system-defined color that has an ARGB value of #FF1493.

    Declaration
    public static Color DeepPink
    Field Value
    Type Description
    Color

    DeepSkyBlue

    Gets a system-defined color that has an ARGB value of #00BFFF.

    Declaration
    public static Color DeepSkyBlue
    Field Value
    Type Description
    Color

    DimGray

    Gets a system-defined color that has an ARGB value of #696969.

    Declaration
    public static Color DimGray
    Field Value
    Type Description
    Color

    DodgerBlue

    Gets a system-defined color that has an ARGB value of #1E90FF.

    Declaration
    public static Color DodgerBlue
    Field Value
    Type Description
    Color

    Empty

    Represents a color that is null.

    Declaration
    public static readonly Color Empty
    Field Value
    Type Description
    Color

    Firebrick

    Gets a system-defined color that has an ARGB value of #B22222.

    Declaration
    public static Color Firebrick
    Field Value
    Type Description
    Color

    FloralWhite

    Gets a system-defined color that has an ARGB value of #FFFAF0.

    Declaration
    public static Color FloralWhite
    Field Value
    Type Description
    Color

    ForestGreen

    Gets a system-defined color that has an ARGB value of #228B22.

    Declaration
    public static Color ForestGreen
    Field Value
    Type Description
    Color

    Fuchsia

    Gets a system-defined color that has an ARGB value of #FF00FF.

    Declaration
    public static Color Fuchsia
    Field Value
    Type Description
    Color

    Gainsboro

    Gets a system-defined color that has an ARGB value of #DCDCDC.

    Declaration
    public static Color Gainsboro
    Field Value
    Type Description
    Color

    GhostWhite

    Gets a system-defined color that has an ARGB value of #F8F8FF.

    Declaration
    public static Color GhostWhite
    Field Value
    Type Description
    Color

    Gold

    Gets a system-defined color that has an ARGB value of #FFD700.

    Declaration
    public static Color Gold
    Field Value
    Type Description
    Color

    Goldenrod

    Gets a system-defined color that has an ARGB value of #DAA520.

    Declaration
    public static Color Goldenrod
    Field Value
    Type Description
    Color

    Gray

    Gets a system-defined color that has an ARGB value of #808080.

    Declaration
    public static Color Gray
    Field Value
    Type Description
    Color

    Green

    Gets a system-defined color that has an ARGB value of #008000.

    Declaration
    public static Color Green
    Field Value
    Type Description
    Color

    GreenYellow

    Gets a system-defined color that has an ARGB value of #ADFF2F.

    Declaration
    public static Color GreenYellow
    Field Value
    Type Description
    Color

    Honeydew

    Gets a system-defined color that has an ARGB value of #F0FFF0.

    Declaration
    public static Color Honeydew
    Field Value
    Type Description
    Color

    HotPink

    Gets a system-defined color that has an ARGB value of #FF69B4.

    Declaration
    public static Color HotPink
    Field Value
    Type Description
    Color

    IndianRed

    Gets a system-defined color that has an ARGB value of #CD5C5C.

    Declaration
    public static Color IndianRed
    Field Value
    Type Description
    Color

    Indigo

    Gets a system-defined color that has an ARGB value of #4B0082.

    Declaration
    public static Color Indigo
    Field Value
    Type Description
    Color

    Ivory

    Gets a system-defined color that has an ARGB value of #FFFFF0.

    Declaration
    public static Color Ivory
    Field Value
    Type Description
    Color

    Khaki

    Gets a system-defined color that has an ARGB value of #F0E68C.

    Declaration
    public static Color Khaki
    Field Value
    Type Description
    Color

    Lavender

    Gets a system-defined color that has an ARGB value of #E6E6FA.

    Declaration
    public static Color Lavender
    Field Value
    Type Description
    Color

    LavenderBlush

    Gets a system-defined color that has an ARGB value of #FFF0F5.

    Declaration
    public static Color LavenderBlush
    Field Value
    Type Description
    Color

    LawnGreen

    Gets a system-defined color that has an ARGB value of #7CFC00.

    Declaration
    public static Color LawnGreen
    Field Value
    Type Description
    Color

    LemonChiffon

    Gets a system-defined color that has an ARGB value of #FFFACD.

    Declaration
    public static Color LemonChiffon
    Field Value
    Type Description
    Color

    LightBlue

    Gets a system-defined color that has an ARGB value of #ADD8E6.

    Declaration
    public static Color LightBlue
    Field Value
    Type Description
    Color

    LightCoral

    Gets a system-defined color that has an ARGB value of #F08080.

    Declaration
    public static Color LightCoral
    Field Value
    Type Description
    Color

    LightCyan

    Gets a system-defined color that has an ARGB value of #E0FFFF.

    Declaration
    public static Color LightCyan
    Field Value
    Type Description
    Color

    LightGoldenrodYellow

    Gets a system-defined color that has an ARGB value of #FAFAD2.

    Declaration
    public static Color LightGoldenrodYellow
    Field Value
    Type Description
    Color

    LightGray

    Gets a system-defined color that has an ARGB value of #D3D3D3.

    Declaration
    public static Color LightGray
    Field Value
    Type Description
    Color

    LightGreen

    Gets a system-defined color that has an ARGB value of #90EE90.

    Declaration
    public static Color LightGreen
    Field Value
    Type Description
    Color

    LightPink

    Gets a system-defined color that has an ARGB value of #FFB6C1.

    Declaration
    public static Color LightPink
    Field Value
    Type Description
    Color

    LightSalmon

    Gets a system-defined color that has an ARGB value of #FFA07A.

    Declaration
    public static Color LightSalmon
    Field Value
    Type Description
    Color

    LightSeaGreen

    Gets a system-defined color that has an ARGB value of #20B2AA.

    Declaration
    public static Color LightSeaGreen
    Field Value
    Type Description
    Color

    LightSkyBlue

    Gets a system-defined color that has an ARGB value of #87CEFA.

    Declaration
    public static Color LightSkyBlue
    Field Value
    Type Description
    Color

    LightSlateGray

    Gets a system-defined color that has an ARGB value of #778899.

    Declaration
    public static Color LightSlateGray
    Field Value
    Type Description
    Color

    LightSteelBlue

    Gets a system-defined color that has an ARGB value of #B0C4DE.

    Declaration
    public static Color LightSteelBlue
    Field Value
    Type Description
    Color

    LightYellow

    Gets a system-defined color that has an ARGB value of #FFFFE0.

    Declaration
    public static Color LightYellow
    Field Value
    Type Description
    Color

    Lime

    Gets a system-defined color that has an ARGB value of #00FF00.

    Declaration
    public static Color Lime
    Field Value
    Type Description
    Color

    LimeGreen

    Gets a system-defined color that has an ARGB value of #32CD32.

    Declaration
    public static Color LimeGreen
    Field Value
    Type Description
    Color

    Linen

    Gets a system-defined color that has an ARGB value of #FAF0E6.

    Declaration
    public static Color Linen
    Field Value
    Type Description
    Color

    Magenta

    Gets a system-defined color that has an ARGB value of #FF00FF.

    Declaration
    public static Color Magenta
    Field Value
    Type Description
    Color

    Maroon

    Gets a system-defined color that has an ARGB value of #800000.

    Declaration
    public static Color Maroon
    Field Value
    Type Description
    Color

    MediumAquamarine

    Gets a system-defined color that has an ARGB value of #66CDAA.

    Declaration
    public static Color MediumAquamarine
    Field Value
    Type Description
    Color

    MediumBlue

    Gets a system-defined color that has an ARGB value of #0000CD.

    Declaration
    public static Color MediumBlue
    Field Value
    Type Description
    Color

    MediumOrchid

    Gets a system-defined color that has an ARGB value of #BA55D3.

    Declaration
    public static Color MediumOrchid
    Field Value
    Type Description
    Color

    MediumPurple

    Gets a system-defined color that has an ARGB value of #9370DB.

    Declaration
    public static Color MediumPurple
    Field Value
    Type Description
    Color

    MediumSeaGreen

    Gets a system-defined color that has an ARGB value of #3CB371.

    Declaration
    public static Color MediumSeaGreen
    Field Value
    Type Description
    Color

    MediumSlateBlue

    Gets a system-defined color that has an ARGB value of #7B68EE.

    Declaration
    public static Color MediumSlateBlue
    Field Value
    Type Description
    Color

    MediumSpringGreen

    Gets a system-defined color that has an ARGB value of #00FA9A.

    Declaration
    public static Color MediumSpringGreen
    Field Value
    Type Description
    Color

    MediumTurquoise

    Gets a system-defined color that has an ARGB value of #48D1CC.

    Declaration
    public static Color MediumTurquoise
    Field Value
    Type Description
    Color

    MediumVioletRed

    Gets a system-defined color that has an ARGB value of #C71585.

    Declaration
    public static Color MediumVioletRed
    Field Value
    Type Description
    Color

    MidnightBlue

    Gets a system-defined color that has an ARGB value of #191970.

    Declaration
    public static Color MidnightBlue
    Field Value
    Type Description
    Color

    MintCream

    Gets a system-defined color that has an ARGB value of #F5FFFA.

    Declaration
    public static Color MintCream
    Field Value
    Type Description
    Color

    MistyRose

    Gets a system-defined color that has an ARGB value of #FFE4E1.

    Declaration
    public static Color MistyRose
    Field Value
    Type Description
    Color

    Moccasin

    Gets a system-defined color that has an ARGB value of #FFE4B5.

    Declaration
    public static Color Moccasin
    Field Value
    Type Description
    Color

    NavajoWhite

    Gets a system-defined color that has an ARGB value of #FFDEAD.

    Declaration
    public static Color NavajoWhite
    Field Value
    Type Description
    Color

    Navy

    Gets a system-defined color that has an ARGB value of #000080.

    Declaration
    public static Color Navy
    Field Value
    Type Description
    Color

    OldLace

    Gets a system-defined color that has an ARGB value of #FDF5E6.

    Declaration
    public static Color OldLace
    Field Value
    Type Description
    Color

    Olive

    Gets a system-defined color that has an ARGB value of #808000.

    Declaration
    public static Color Olive
    Field Value
    Type Description
    Color

    OliveDrab

    Gets a system-defined color that has an ARGB value of #6B8E23.

    Declaration
    public static Color OliveDrab
    Field Value
    Type Description
    Color

    Orange

    Gets a system-defined color that has an ARGB value of #FFA500.

    Declaration
    public static Color Orange
    Field Value
    Type Description
    Color

    OrangeRed

    Gets a system-defined color that has an ARGB value of #FF4500.

    Declaration
    public static Color OrangeRed
    Field Value
    Type Description
    Color

    Orchid

    Gets a system-defined color that has an ARGB value of #DA70D6.

    Declaration
    public static Color Orchid
    Field Value
    Type Description
    Color

    PaleGoldenrod

    Gets a system-defined color that has an ARGB value of #EEE8AA.

    Declaration
    public static Color PaleGoldenrod
    Field Value
    Type Description
    Color

    PaleGreen

    Gets a system-defined color that has an ARGB value of #98FB98.

    Declaration
    public static Color PaleGreen
    Field Value
    Type Description
    Color

    PaleTurquoise

    Gets a system-defined color that has an ARGB value of #AFEEEE.

    Declaration
    public static Color PaleTurquoise
    Field Value
    Type Description
    Color

    PaleVioletRed

    Gets a system-defined color that has an ARGB value of #DB7093.

    Declaration
    public static Color PaleVioletRed
    Field Value
    Type Description
    Color

    PapayaWhip

    Gets a system-defined color that has an ARGB value of #FFEFD5.

    Declaration
    public static Color PapayaWhip
    Field Value
    Type Description
    Color

    PeachPuff

    Gets a system-defined color that has an ARGB value of #FFDAB9.

    Declaration
    public static Color PeachPuff
    Field Value
    Type Description
    Color

    Peru

    Gets a system-defined color that has an ARGB value of #CD853F.

    Declaration
    public static Color Peru
    Field Value
    Type Description
    Color

    Pink

    Gets a system-defined color that has an ARGB value of #FFC0CB.

    Declaration
    public static Color Pink
    Field Value
    Type Description
    Color

    Plum

    Gets a system-defined color that has an ARGB value of #DDA0DD.

    Declaration
    public static Color Plum
    Field Value
    Type Description
    Color

    PowderBlue

    Gets a system-defined color that has an ARGB value of #B0E0E6.

    Declaration
    public static Color PowderBlue
    Field Value
    Type Description
    Color

    Purple

    Gets a system-defined color that has an ARGB value of #800080.

    Declaration
    public static Color Purple
    Field Value
    Type Description
    Color

    RebeccaPurple

    Gets a system-defined color that has an ARGB value of #663399.

    Declaration
    public static Color RebeccaPurple
    Field Value
    Type Description
    Color

    Red

    Gets a system-defined color that has an ARGB value of #FF0000.

    Declaration
    public static Color Red
    Field Value
    Type Description
    Color

    RosyBrown

    Gets a system-defined color that has an ARGB value of #BC8F8F.

    Declaration
    public static Color RosyBrown
    Field Value
    Type Description
    Color

    RoyalBlue

    Gets a system-defined color that has an ARGB value of #4169E1.

    Declaration
    public static Color RoyalBlue
    Field Value
    Type Description
    Color

    SaddleBrown

    Gets a system-defined color that has an ARGB value of #8B4513.

    Declaration
    public static Color SaddleBrown
    Field Value
    Type Description
    Color

    Salmon

    Gets a system-defined color that has an ARGB value of #FA8072.

    Declaration
    public static Color Salmon
    Field Value
    Type Description
    Color

    SandyBrown

    Gets a system-defined color that has an ARGB value of #F4A460.

    Declaration
    public static Color SandyBrown
    Field Value
    Type Description
    Color

    SeaGreen

    Gets a system-defined color that has an ARGB value of #2E8B57.

    Declaration
    public static Color SeaGreen
    Field Value
    Type Description
    Color

    SeaShell

    Gets a system-defined color that has an ARGB value of #FFF5EE.

    Declaration
    public static Color SeaShell
    Field Value
    Type Description
    Color

    Sienna

    Gets a system-defined color that has an ARGB value of #A0522D.

    Declaration
    public static Color Sienna
    Field Value
    Type Description
    Color

    Silver

    Gets a system-defined color that has an ARGB value of #C0C0C0.

    Declaration
    public static Color Silver
    Field Value
    Type Description
    Color

    SkyBlue

    Gets a system-defined color that has an ARGB value of #87CEEB.

    Declaration
    public static Color SkyBlue
    Field Value
    Type Description
    Color

    SlateBlue

    Gets a system-defined color that has an ARGB value of #6A5ACD.

    Declaration
    public static Color SlateBlue
    Field Value
    Type Description
    Color

    SlateGray

    Gets a system-defined color that has an ARGB value of #708090.

    Declaration
    public static Color SlateGray
    Field Value
    Type Description
    Color

    Snow

    Gets a system-defined color that has an ARGB value of #FFFAFA.

    Declaration
    public static Color Snow
    Field Value
    Type Description
    Color

    SpringGreen

    Gets a system-defined color that has an ARGB value of #00FF7F.

    Declaration
    public static Color SpringGreen
    Field Value
    Type Description
    Color

    SteelBlue

    Gets a system-defined color that has an ARGB value of #4682B4.

    Declaration
    public static Color SteelBlue
    Field Value
    Type Description
    Color

    Tan

    Gets a system-defined color that has an ARGB value of #D2B48C.

    Declaration
    public static Color Tan
    Field Value
    Type Description
    Color

    Teal

    Gets a system-defined color that has an ARGB value of #008080.

    Declaration
    public static Color Teal
    Field Value
    Type Description
    Color

    Thistle

    Gets a system-defined color that has an ARGB value of #D2B48C.

    Declaration
    public static Color Thistle
    Field Value
    Type Description
    Color

    Tomato

    Gets a system-defined color that has an ARGB value of #FF6347.

    Declaration
    public static Color Tomato
    Field Value
    Type Description
    Color

    Transparent

    Gets a system-defined color that has an ARGB value of #00FFFFFF.

    Declaration
    public static Color Transparent
    Field Value
    Type Description
    Color

    Turquoise

    Gets a system-defined color that has an ARGB value of #40E0D0.

    Declaration
    public static Color Turquoise
    Field Value
    Type Description
    Color

    Violet

    Gets a system-defined color that has an ARGB value of #EE82EE.

    Declaration
    public static Color Violet
    Field Value
    Type Description
    Color

    Wheat

    Gets a system-defined color that has an ARGB value of #F5DEB3.

    Declaration
    public static Color Wheat
    Field Value
    Type Description
    Color

    White

    Gets a system-defined color that has an ARGB value of #FFFFFF.

    Declaration
    public static Color White
    Field Value
    Type Description
    Color

    WhiteSmoke

    Gets a system-defined color that has an ARGB value of #F5F5F5.

    Declaration
    public static Color WhiteSmoke
    Field Value
    Type Description
    Color

    Yellow

    Gets a system-defined color that has an ARGB value of #FFFF00.

    Declaration
    public static Color Yellow
    Field Value
    Type Description
    Color

    YellowGreen

    Gets a system-defined color that has an ARGB value of #9ACD32.

    Declaration
    public static Color YellowGreen
    Field Value
    Type Description
    Color

    Properties

    A

    Gets the alpha component value of this Color structure.

    Declaration
    public byte A { get; }
    Property Value
    Type Description
    System.Byte

    B

    Gets the blue component value of this Color structure.

    Declaration
    public byte B { get; }
    Property Value
    Type Description
    System.Byte

    G

    Gets the green component value of this Color structure.

    Declaration
    public byte G { get; }
    Property Value
    Type Description
    System.Byte

    R

    Gets the red component value of this Color structure.

    Declaration
    public byte R { get; }
    Property Value
    Type Description
    System.Byte

    Methods

    Equals(Object)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public override bool Equals(object other)
    Parameters
    Type Name Description
    System.Object other

    An object to compare with this object.

    Returns
    Type Description
    System.Boolean

    true if the current object is equal to other; otherwise, false.

    FromArgb(Int32)

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

    Declaration
    public static Color FromArgb(int argb)
    Parameters
    Type Name Description
    System.Int32 argb

    A value specifying the 32-bit ARGB value.

    Returns
    Type Description
    Color

    Color

    See Also
    FromArgb(Int32, Color)
    FromArgb(Int32, Int32, Int32)
    FromArgb(Int32, Int32, Int32, Int32)

    FromArgb(Int32, Color)

    Creates a Color structure from the specified Color structure, but with the new specified alpha value.

    Although this method allows a 32-bit value to be passed for the alpha value, the value is limited to 8 bits.

    Declaration
    public static Color FromArgb(int alpha, Color baseColor)
    Parameters
    Type Name Description
    System.Int32 alpha

    The alpha value for the new Color. Valid values are 0 through 255.

    Color baseColor

    The Color from which to create the new Color.

    Returns
    Type Description
    Color

    Color

    See Also
    FromArgb(Int32)
    FromArgb(Int32, Int32, Int32)
    FromArgb(Int32, Int32, Int32, Int32)

    FromArgb(Int32, Int32, Int32)

    Creates a Color 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.

    Declaration
    public static Color FromArgb(int red, int green, int blue)
    Parameters
    Type Name Description
    System.Int32 red

    The red component value for the new Color. Valid values are 0 through 255.

    System.Int32 green

    The green component value for the new Color. Valid values are 0 through 255.

    System.Int32 blue

    The blue component value for the new Color. Valid values are 0 through 255.

    Returns
    Type Description
    Color

    Color

    See Also
    FromArgb(Int32)
    FromArgb(Int32, Color)
    FromArgb(Int32, Int32, Int32, Int32)

    FromArgb(Int32, Int32, Int32, Int32)

    Creates a Color structure from the specified 8-bit color values (alpha, red, green, and blue). 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.

    Declaration
    public static Color FromArgb(int alpha, int red, int green, int blue)
    Parameters
    Type Name Description
    System.Int32 alpha

    The alpha value for the new Color. Valid values are 0 through 255.

    System.Int32 red

    The red component value for the new Color. Valid values are 0 through 255.

    System.Int32 green

    The green component value for the new Color. Valid values are 0 through 255.

    System.Int32 blue

    The blue component value for the new Color. Valid values are 0 through 255.

    Returns
    Type Description
    Color

    Color

    See Also
    FromArgb(Int32)
    FromArgb(Int32, Color)
    FromArgb(Int32, Int32, Int32)

    FromName(String)

    Creates a Color structure from the specified name of a predefined color.

    Declaration
    public static Color FromName(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    Color

    Color

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    GetLuminance()

    Luminance is a value from 0 (black) to 100 (white) where 50 is the perceptual "middle grey". Luminance = 50 is the equivalent of Y = 18.4, or in other words a 18% grey card, representing the middle of a photographic exposure.

    Declaration
    public double GetLuminance()
    Returns
    Type Description
    System.Double

    Preceived Lightness

    ToArgb()

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

    Further Documentation:
    Code Example

    Declaration
    public int ToArgb()
    Returns
    Type Description
    System.Int32

    The 32-bit ARGB value of this Color.

    ToHtmlCssColorCode()

    Translates the specified Color structure to an HTML string color representation.

    Declaration
    public string ToHtmlCssColorCode()
    Returns
    Type Description
    System.String

    A string containing the hex representation of the color in the format #RRGGBB.

    ToString()

    Returns the color as a string in the format: #AARRGGBB.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    Operators

    Equality(Color, Color)

    Tests whether two specified Color structures are equivalent.

    Declaration
    public static bool operator ==(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The Color that is to the left of the equality operator.

    Color right

    The Color that is to the right of the equality operator.

    Returns
    Type Description
    System.Boolean

    true if the two Color structures are equal; otherwise, false.

    Implicit(Color to Color)

    Implicitly casts to Microsoft.Maui.Graphics.Color objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support Microsoft.Maui.Graphics.Color as well.

    Declaration
    public static implicit operator Color(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a Microsoft.Maui.Graphics.Color

    Returns
    Type Description
    Microsoft.Maui.Graphics.Color

    Implicit(Color to Color)

    Implicitly casts to SixLabors.ImageSharp.Color objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.Color as well.

    Declaration
    public static implicit operator Color(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.Color

    Returns
    Type Description
    SixLabors.ImageSharp.Color

    Implicit(Color to Abgr32)

    Implicitly casts to SixLabors.ImageSharp.PixelFormats.Abgr32 objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Abgr32 as well.

    Declaration
    public static implicit operator Abgr32(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.PixelFormats.Abgr32

    Returns
    Type Description
    SixLabors.ImageSharp.PixelFormats.Abgr32

    Implicit(Color to Argb32)

    Implicitly casts to SixLabors.ImageSharp.PixelFormats.Argb32 objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Argb32 as well.

    Declaration
    public static implicit operator Argb32(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.PixelFormats.Argb32

    Returns
    Type Description
    SixLabors.ImageSharp.PixelFormats.Argb32

    Implicit(Color to Bgr24)

    Implicitly casts to SixLabors.ImageSharp.PixelFormats.Bgr24 objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Bgr24 as well.

    Declaration
    public static implicit operator Bgr24(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.PixelFormats.Bgr24

    Returns
    Type Description
    SixLabors.ImageSharp.PixelFormats.Bgr24

    Implicit(Color to Bgra32)

    Implicitly casts to SixLabors.ImageSharp.PixelFormats.Bgra32 objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Bgra32 as well.

    Declaration
    public static implicit operator Bgra32(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.PixelFormats.Bgra32

    Returns
    Type Description
    SixLabors.ImageSharp.PixelFormats.Bgra32

    Implicit(Color to Rgb24)

    Implicitly casts to SixLabors.ImageSharp.PixelFormats.Rgb24 objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Rgb24 as well.

    Declaration
    public static implicit operator Rgb24(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.PixelFormats.Rgb24

    Returns
    Type Description
    SixLabors.ImageSharp.PixelFormats.Rgb24

    Implicit(Color to Rgb48)

    Implicitly casts to SixLabors.ImageSharp.PixelFormats.Rgb48 objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Rgb48 as well.

    Declaration
    public static implicit operator Rgb48(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.PixelFormats.Rgb48

    Returns
    Type Description
    SixLabors.ImageSharp.PixelFormats.Rgb48

    Implicit(Color to Rgba32)

    Implicitly casts to SixLabors.ImageSharp.PixelFormats.Rgba32 objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Rgba32 as well.

    Declaration
    public static implicit operator Rgba32(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.PixelFormats.Rgba32

    Returns
    Type Description
    SixLabors.ImageSharp.PixelFormats.Rgba32

    Implicit(Color to Rgba64)

    Implicitly casts to SixLabors.ImageSharp.PixelFormats.Rgba64 objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Rgba64 as well.

    Declaration
    public static implicit operator Rgba64(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SixLabors.ImageSharp.PixelFormats.Rgba64

    Returns
    Type Description
    SixLabors.ImageSharp.PixelFormats.Rgba64

    Implicit(Color to SKColor)

    Implicitly casts to SkiaSharp.SKColor objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SkiaSharp.SKColor as well.

    Declaration
    public static implicit operator SKColor(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a SkiaSharp.SKColor

    Returns
    Type Description
    SkiaSharp.SKColor

    Implicit(Color to Color)

    Implicitly casts to System.Drawing.Color objects from Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support System.Drawing.Color as well.

    Declaration
    public static implicit operator Color(Color Color)
    Parameters
    Type Name Description
    Color Color

    Color is explicitly cast to a System.Drawing.Color

    Returns
    Type Description
    System.Drawing.Color

    Implicit(Color to Color)

    Implicitly casts Microsoft.Maui.Graphics.Color objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support Microsoft.Maui.Graphics.Color as well.

    Declaration
    public static implicit operator Color(Color Color)
    Parameters
    Type Name Description
    Microsoft.Maui.Graphics.Color Color

    Microsoft.Maui.Graphics.Color will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Color to Color)

    Implicitly casts SixLabors.ImageSharp.Color objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.Color as well.

    Declaration
    public static implicit operator Color(Color Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.Color Color

    SixLabors.ImageSharp.Color will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Abgr32 to Color)

    Implicitly casts SixLabors.ImageSharp.PixelFormats.Abgr32 objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Abgr32 as well.

    Declaration
    public static implicit operator Color(Abgr32 Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.PixelFormats.Abgr32 Color

    SixLabors.ImageSharp.PixelFormats.Abgr32 will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Argb32 to Color)

    Implicitly casts SixLabors.ImageSharp.PixelFormats.Argb32 objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Argb32 as well.

    Declaration
    public static implicit operator Color(Argb32 Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.PixelFormats.Argb32 Color

    SixLabors.ImageSharp.PixelFormats.Argb32 will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Bgr24 to Color)

    Implicitly casts SixLabors.ImageSharp.PixelFormats.Bgr24 objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Bgr24 as well.

    Declaration
    public static implicit operator Color(Bgr24 Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.PixelFormats.Bgr24 Color

    SixLabors.ImageSharp.PixelFormats.Bgr24 will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Bgra32 to Color)

    Implicitly casts SixLabors.ImageSharp.PixelFormats.Bgra32 objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Bgra32 as well.

    Declaration
    public static implicit operator Color(Bgra32 Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.PixelFormats.Bgra32 Color

    SixLabors.ImageSharp.PixelFormats.Bgra32 will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Rgb24 to Color)

    Implicitly casts SixLabors.ImageSharp.PixelFormats.Rgb24 objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Rgb24 as well.

    Declaration
    public static implicit operator Color(Rgb24 Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.PixelFormats.Rgb24 Color

    SixLabors.ImageSharp.PixelFormats.Rgb24 will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Rgb48 to Color)

    Implicitly casts SixLabors.ImageSharp.PixelFormats.Rgb48 objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Rgb48 as well.

    Declaration
    public static implicit operator Color(Rgb48 Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.PixelFormats.Rgb48 Color

    SixLabors.ImageSharp.PixelFormats.Rgb48 will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Rgba32 to Color)

    Implicitly casts SixLabors.ImageSharp.PixelFormats.Rgba32 objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Rgba32 as well.

    Declaration
    public static implicit operator Color(Rgba32 Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.PixelFormats.Rgba32 Color

    SixLabors.ImageSharp.PixelFormats.Rgba32 will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Rgba64 to Color)

    Implicitly casts SixLabors.ImageSharp.PixelFormats.Rgba64 objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SixLabors.ImageSharp.PixelFormats.Rgba64 as well.

    Declaration
    public static implicit operator Color(Rgba64 Color)
    Parameters
    Type Name Description
    SixLabors.ImageSharp.PixelFormats.Rgba64 Color

    SixLabors.ImageSharp.PixelFormats.Rgba64 will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(SKColor to Color)

    Implicitly casts SkiaSharp.SKColor objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support SkiaSharp.SKColor as well.

    Declaration
    public static implicit operator Color(SKColor Color)
    Parameters
    Type Name Description
    SkiaSharp.SKColor Color

    SkiaSharp.SKColor will automatically be cast to Color

    Returns
    Type Description
    Color

    Implicit(Color to Color)

    Implicitly casts System.Drawing.Color objects to Color.

    When your .NET Class methods use Color as parameters or return types, you now automatically support System.Drawing.Color as well.

    Declaration
    public static implicit operator Color(Color Color)
    Parameters
    Type Name Description
    System.Drawing.Color Color

    System.Drawing.Color will automatically be cast to Color

    Returns
    Type Description
    Color

    Inequality(Color, Color)

    Tests whether two specified Color structures are different.

    Declaration
    public static bool operator !=(Color left, Color right)
    Parameters
    Type Name Description
    Color left

    The Color that is to the left of the inequality operator.

    Color right

    The Color that is to the right of the inequality operator.

    Returns
    Type Description
    System.Boolean

    true if the two Color structures are different; otherwise, false.

    ☀
    ☾
    Downloads
    • Download with Nuget
    In This Article
    Back to top
    Install with Nuget
    Want to deploy IronDrawing to a live project for FREE?
    What’s included?
    30 days of fully-functional product
    Test and share in a live environment
    No watermarks in production
    Get your free 30-day Trial Key instantly.
    No credit card or account creation required
    Your Trial License Key has been emailed to you.
    Download IronDrawing free to apply
    your Trial Licenses Key
    Install with NuGet View Licenses
    Licenses from $499. Have a question? Get in touch.