Struct Color
Represents a color value that is convertible to any IPixel<TSelf> type.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp
Assembly: SixLabors.ImageSharp.dll
Syntax
public readonly struct Color : IEquatable<Color>Remarks
The internal representation and layout of this structure is hidden by intention. It's not serializable, and it should not be considered as part of a contract. Unlike System.Drawing.Color, Color has to be converted to a specific pixel value to query the color components.
Constructors
| Improve this Doc View SourceColor(Abgr32)
Initializes a new instance of the Color struct.
Declaration
public Color(Abgr32 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| Abgr32 | pixel | The Abgr32 containing the color information. | 
Color(Argb32)
Initializes a new instance of the Color struct.
Declaration
public Color(Argb32 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| Argb32 | pixel | The Argb32 containing the color information. | 
Color(Bgr24)
Initializes a new instance of the Color struct.
Declaration
public Color(Bgr24 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| Bgr24 | pixel | The Bgr24 containing the color information. | 
Color(Bgra32)
Initializes a new instance of the Color struct.
Declaration
public Color(Bgra32 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| Bgra32 | pixel | The Bgra32 containing the color information. | 
Color(L16)
Initializes a new instance of the Color struct.
Declaration
public Color(L16 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| L16 | pixel | The L16 containing the color information. | 
Color(La32)
Initializes a new instance of the Color struct.
Declaration
public Color(La32 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| La32 | pixel | The La32 containing the color information. | 
Color(Rgb24)
Initializes a new instance of the Color struct.
Declaration
public Color(Rgb24 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| Rgb24 | pixel | The Rgb24 containing the color information. | 
Color(Rgb48)
Initializes a new instance of the Color struct.
Declaration
public Color(Rgb48 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| Rgb48 | pixel | The Rgb48 containing the color information. | 
Color(Rgba32)
Initializes a new instance of the Color struct.
Declaration
public Color(Rgba32 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| Rgba32 | pixel | The Rgba32 containing the color information. | 
Color(Rgba64)
Initializes a new instance of the Color struct.
Declaration
public Color(Rgba64 pixel)Parameters
| Type | Name | Description | 
|---|---|---|
| Rgba64 | pixel | The Rgba64 containing the color information. | 
Color(Vector4)
Initializes a new instance of the Color struct.
Declaration
public Color(Vector4 vector)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector4 | vector | The Vector4 containing the color information. | 
Fields
| Improve this Doc View SourceAliceBlue
Represents a 
Declaration
public static readonly Color AliceBlueField Value
| Type | Description | 
|---|---|
| Color | 
AntiqueWhite
Represents a 
Declaration
public static readonly Color AntiqueWhiteField Value
| Type | Description | 
|---|---|
| Color | 
Aqua
Represents a 
Declaration
public static readonly Color AquaField Value
| Type | Description | 
|---|---|
| Color | 
Aquamarine
Represents a 
Declaration
public static readonly Color AquamarineField Value
| Type | Description | 
|---|---|
| Color | 
Azure
Represents a 
Declaration
public static readonly Color AzureField Value
| Type | Description | 
|---|---|
| Color | 
Beige
Represents a 
Declaration
public static readonly Color BeigeField Value
| Type | Description | 
|---|---|
| Color | 
Bisque
Represents a 
Declaration
public static readonly Color BisqueField Value
| Type | Description | 
|---|---|
| Color | 
Black
Represents a 
Declaration
public static readonly Color BlackField Value
| Type | Description | 
|---|---|
| Color | 
BlanchedAlmond
Represents a 
Declaration
public static readonly Color BlanchedAlmondField Value
| Type | Description | 
|---|---|
| Color | 
Blue
Represents a 
Declaration
public static readonly Color BlueField Value
| Type | Description | 
|---|---|
| Color | 
BlueViolet
Represents a 
Declaration
public static readonly Color BlueVioletField Value
| Type | Description | 
|---|---|
| Color | 
Brown
Represents a 
Declaration
public static readonly Color BrownField Value
| Type | Description | 
|---|---|
| Color | 
BurlyWood
Represents a 
Declaration
public static readonly Color BurlyWoodField Value
| Type | Description | 
|---|---|
| Color | 
CadetBlue
Represents a 
Declaration
public static readonly Color CadetBlueField Value
| Type | Description | 
|---|---|
| Color | 
Chartreuse
Represents a 
Declaration
public static readonly Color ChartreuseField Value
| Type | Description | 
|---|---|
| Color | 
Chocolate
Represents a 
Declaration
public static readonly Color ChocolateField Value
| Type | Description | 
|---|---|
| Color | 
Coral
Represents a 
Declaration
public static readonly Color CoralField Value
| Type | Description | 
|---|---|
| Color | 
CornflowerBlue
Represents a 
Declaration
public static readonly Color CornflowerBlueField Value
| Type | Description | 
|---|---|
| Color | 
Cornsilk
Represents a 
Declaration
public static readonly Color CornsilkField Value
| Type | Description | 
|---|---|
| Color | 
Crimson
Represents a 
Declaration
public static readonly Color CrimsonField Value
| Type | Description | 
|---|---|
| Color | 
Cyan
Represents a 
Declaration
public static readonly Color CyanField Value
| Type | Description | 
|---|---|
| Color | 
DarkBlue
Represents a 
Declaration
public static readonly Color DarkBlueField Value
| Type | Description | 
|---|---|
| Color | 
DarkCyan
Represents a 
Declaration
public static readonly Color DarkCyanField Value
| Type | Description | 
|---|---|
| Color | 
DarkGoldenrod
Represents a 
Declaration
public static readonly Color DarkGoldenrodField Value
| Type | Description | 
|---|---|
| Color | 
DarkGray
Represents a 
Declaration
public static readonly Color DarkGrayField Value
| Type | Description | 
|---|---|
| Color | 
DarkGreen
Represents a 
Declaration
public static readonly Color DarkGreenField Value
| Type | Description | 
|---|---|
| Color | 
DarkGrey
Represents a 
Declaration
public static readonly Color DarkGreyField Value
| Type | Description | 
|---|---|
| Color | 
DarkKhaki
Represents a 
Declaration
public static readonly Color DarkKhakiField Value
| Type | Description | 
|---|---|
| Color | 
DarkMagenta
Represents a 
Declaration
public static readonly Color DarkMagentaField Value
| Type | Description | 
|---|---|
| Color | 
DarkOliveGreen
Represents a 
Declaration
public static readonly Color DarkOliveGreenField Value
| Type | Description | 
|---|---|
| Color | 
DarkOrange
Represents a 
Declaration
public static readonly Color DarkOrangeField Value
| Type | Description | 
|---|---|
| Color | 
DarkOrchid
Represents a 
Declaration
public static readonly Color DarkOrchidField Value
| Type | Description | 
|---|---|
| Color | 
DarkRed
Represents a 
Declaration
public static readonly Color DarkRedField Value
| Type | Description | 
|---|---|
| Color | 
DarkSalmon
Represents a 
Declaration
public static readonly Color DarkSalmonField Value
| Type | Description | 
|---|---|
| Color | 
DarkSeaGreen
Represents a 
Declaration
public static readonly Color DarkSeaGreenField Value
| Type | Description | 
|---|---|
| Color | 
DarkSlateBlue
Represents a 
Declaration
public static readonly Color DarkSlateBlueField Value
| Type | Description | 
|---|---|
| Color | 
DarkSlateGray
Represents a 
Declaration
public static readonly Color DarkSlateGrayField Value
| Type | Description | 
|---|---|
| Color | 
DarkSlateGrey
Represents a 
Declaration
public static readonly Color DarkSlateGreyField Value
| Type | Description | 
|---|---|
| Color | 
DarkTurquoise
Represents a 
Declaration
public static readonly Color DarkTurquoiseField Value
| Type | Description | 
|---|---|
| Color | 
DarkViolet
Represents a 
Declaration
public static readonly Color DarkVioletField Value
| Type | Description | 
|---|---|
| Color | 
DeepPink
Represents a 
Declaration
public static readonly Color DeepPinkField Value
| Type | Description | 
|---|---|
| Color | 
DeepSkyBlue
Represents a 
Declaration
public static readonly Color DeepSkyBlueField Value
| Type | Description | 
|---|---|
| Color | 
DimGray
Represents a 
Declaration
public static readonly Color DimGrayField Value
| Type | Description | 
|---|---|
| Color | 
DimGrey
Represents a 
Declaration
public static readonly Color DimGreyField Value
| Type | Description | 
|---|---|
| Color | 
DodgerBlue
Represents a 
Declaration
public static readonly Color DodgerBlueField Value
| Type | Description | 
|---|---|
| Color | 
Firebrick
Represents a 
Declaration
public static readonly Color FirebrickField Value
| Type | Description | 
|---|---|
| Color | 
FloralWhite
Represents a 
Declaration
public static readonly Color FloralWhiteField Value
| Type | Description | 
|---|---|
| Color | 
ForestGreen
Represents a 
Declaration
public static readonly Color ForestGreenField Value
| Type | Description | 
|---|---|
| Color | 
Fuchsia
Represents a 
Declaration
public static readonly Color FuchsiaField Value
| Type | Description | 
|---|---|
| Color | 
Gainsboro
Represents a 
Declaration
public static readonly Color GainsboroField Value
| Type | Description | 
|---|---|
| Color | 
GhostWhite
Represents a 
Declaration
public static readonly Color GhostWhiteField Value
| Type | Description | 
|---|---|
| Color | 
Gold
Represents a 
Declaration
public static readonly Color GoldField Value
| Type | Description | 
|---|---|
| Color | 
Goldenrod
Represents a 
Declaration
public static readonly Color GoldenrodField Value
| Type | Description | 
|---|---|
| Color | 
Gray
Represents a 
Declaration
public static readonly Color GrayField Value
| Type | Description | 
|---|---|
| Color | 
Green
Represents a 
Declaration
public static readonly Color GreenField Value
| Type | Description | 
|---|---|
| Color | 
GreenYellow
Represents a 
Declaration
public static readonly Color GreenYellowField Value
| Type | Description | 
|---|---|
| Color | 
Grey
Represents a 
Declaration
public static readonly Color GreyField Value
| Type | Description | 
|---|---|
| Color | 
Honeydew
Represents a 
Declaration
public static readonly Color HoneydewField Value
| Type | Description | 
|---|---|
| Color | 
HotPink
Represents a 
Declaration
public static readonly Color HotPinkField Value
| Type | Description | 
|---|---|
| Color | 
IndianRed
Represents a 
Declaration
public static readonly Color IndianRedField Value
| Type | Description | 
|---|---|
| Color | 
Indigo
Represents a 
Declaration
public static readonly Color IndigoField Value
| Type | Description | 
|---|---|
| Color | 
Ivory
Represents a 
Declaration
public static readonly Color IvoryField Value
| Type | Description | 
|---|---|
| Color | 
Khaki
Represents a 
Declaration
public static readonly Color KhakiField Value
| Type | Description | 
|---|---|
| Color | 
Lavender
Represents a 
Declaration
public static readonly Color LavenderField Value
| Type | Description | 
|---|---|
| Color | 
LavenderBlush
Represents a 
Declaration
public static readonly Color LavenderBlushField Value
| Type | Description | 
|---|---|
| Color | 
LawnGreen
Represents a 
Declaration
public static readonly Color LawnGreenField Value
| Type | Description | 
|---|---|
| Color | 
LemonChiffon
Represents a 
Declaration
public static readonly Color LemonChiffonField Value
| Type | Description | 
|---|---|
| Color | 
LightBlue
Represents a 
Declaration
public static readonly Color LightBlueField Value
| Type | Description | 
|---|---|
| Color | 
LightCoral
Represents a 
Declaration
public static readonly Color LightCoralField Value
| Type | Description | 
|---|---|
| Color | 
LightCyan
Represents a 
Declaration
public static readonly Color LightCyanField Value
| Type | Description | 
|---|---|
| Color | 
LightGoldenrodYellow
Represents a 
Declaration
public static readonly Color LightGoldenrodYellowField Value
| Type | Description | 
|---|---|
| Color | 
LightGray
Represents a 
Declaration
public static readonly Color LightGrayField Value
| Type | Description | 
|---|---|
| Color | 
LightGreen
Represents a 
Declaration
public static readonly Color LightGreenField Value
| Type | Description | 
|---|---|
| Color | 
LightGrey
Represents a 
Declaration
public static readonly Color LightGreyField Value
| Type | Description | 
|---|---|
| Color | 
LightPink
Represents a 
Declaration
public static readonly Color LightPinkField Value
| Type | Description | 
|---|---|
| Color | 
LightSalmon
Represents a 
Declaration
public static readonly Color LightSalmonField Value
| Type | Description | 
|---|---|
| Color | 
LightSeaGreen
Represents a 
Declaration
public static readonly Color LightSeaGreenField Value
| Type | Description | 
|---|---|
| Color | 
LightSkyBlue
Represents a 
Declaration
public static readonly Color LightSkyBlueField Value
| Type | Description | 
|---|---|
| Color | 
LightSlateGray
Represents a 
Declaration
public static readonly Color LightSlateGrayField Value
| Type | Description | 
|---|---|
| Color | 
LightSlateGrey
Represents a 
Declaration
public static readonly Color LightSlateGreyField Value
| Type | Description | 
|---|---|
| Color | 
LightSteelBlue
Represents a 
Declaration
public static readonly Color LightSteelBlueField Value
| Type | Description | 
|---|---|
| Color | 
LightYellow
Represents a 
Declaration
public static readonly Color LightYellowField Value
| Type | Description | 
|---|---|
| Color | 
Lime
Represents a 
Declaration
public static readonly Color LimeField Value
| Type | Description | 
|---|---|
| Color | 
LimeGreen
Represents a 
Declaration
public static readonly Color LimeGreenField Value
| Type | Description | 
|---|---|
| Color | 
Linen
Represents a 
Declaration
public static readonly Color LinenField Value
| Type | Description | 
|---|---|
| Color | 
Magenta
Represents a 
Declaration
public static readonly Color MagentaField Value
| Type | Description | 
|---|---|
| Color | 
Maroon
Represents a 
Declaration
public static readonly Color MaroonField Value
| Type | Description | 
|---|---|
| Color | 
MediumAquamarine
Represents a 
Declaration
public static readonly Color MediumAquamarineField Value
| Type | Description | 
|---|---|
| Color | 
MediumBlue
Represents a 
Declaration
public static readonly Color MediumBlueField Value
| Type | Description | 
|---|---|
| Color | 
MediumOrchid
Represents a 
Declaration
public static readonly Color MediumOrchidField Value
| Type | Description | 
|---|---|
| Color | 
MediumPurple
Represents a 
Declaration
public static readonly Color MediumPurpleField Value
| Type | Description | 
|---|---|
| Color | 
MediumSeaGreen
Represents a 
Declaration
public static readonly Color MediumSeaGreenField Value
| Type | Description | 
|---|---|
| Color | 
MediumSlateBlue
Represents a 
Declaration
public static readonly Color MediumSlateBlueField Value
| Type | Description | 
|---|---|
| Color | 
MediumSpringGreen
Represents a 
Declaration
public static readonly Color MediumSpringGreenField Value
| Type | Description | 
|---|---|
| Color | 
MediumTurquoise
Represents a 
Declaration
public static readonly Color MediumTurquoiseField Value
| Type | Description | 
|---|---|
| Color | 
MediumVioletRed
Represents a 
Declaration
public static readonly Color MediumVioletRedField Value
| Type | Description | 
|---|---|
| Color | 
MidnightBlue
Represents a 
Declaration
public static readonly Color MidnightBlueField Value
| Type | Description | 
|---|---|
| Color | 
MintCream
Represents a 
Declaration
public static readonly Color MintCreamField Value
| Type | Description | 
|---|---|
| Color | 
MistyRose
Represents a 
Declaration
public static readonly Color MistyRoseField Value
| Type | Description | 
|---|---|
| Color | 
Moccasin
Represents a 
Declaration
public static readonly Color MoccasinField Value
| Type | Description | 
|---|---|
| Color | 
NavajoWhite
Represents a 
Declaration
public static readonly Color NavajoWhiteField Value
| Type | Description | 
|---|---|
| Color | 
Navy
Represents a 
Declaration
public static readonly Color NavyField Value
| Type | Description | 
|---|---|
| Color | 
OldLace
Represents a 
Declaration
public static readonly Color OldLaceField Value
| Type | Description | 
|---|---|
| Color | 
Olive
Represents a 
Declaration
public static readonly Color OliveField Value
| Type | Description | 
|---|---|
| Color | 
OliveDrab
Represents a 
Declaration
public static readonly Color OliveDrabField Value
| Type | Description | 
|---|---|
| Color | 
Orange
Represents a 
Declaration
public static readonly Color OrangeField Value
| Type | Description | 
|---|---|
| Color | 
OrangeRed
Represents a 
Declaration
public static readonly Color OrangeRedField Value
| Type | Description | 
|---|---|
| Color | 
Orchid
Represents a 
Declaration
public static readonly Color OrchidField Value
| Type | Description | 
|---|---|
| Color | 
PaleGoldenrod
Represents a 
Declaration
public static readonly Color PaleGoldenrodField Value
| Type | Description | 
|---|---|
| Color | 
PaleGreen
Represents a 
Declaration
public static readonly Color PaleGreenField Value
| Type | Description | 
|---|---|
| Color | 
PaleTurquoise
Represents a 
Declaration
public static readonly Color PaleTurquoiseField Value
| Type | Description | 
|---|---|
| Color | 
PaleVioletRed
Represents a 
Declaration
public static readonly Color PaleVioletRedField Value
| Type | Description | 
|---|---|
| Color | 
PapayaWhip
Represents a 
Declaration
public static readonly Color PapayaWhipField Value
| Type | Description | 
|---|---|
| Color | 
PeachPuff
Represents a 
Declaration
public static readonly Color PeachPuffField Value
| Type | Description | 
|---|---|
| Color | 
Peru
Represents a 
Declaration
public static readonly Color PeruField Value
| Type | Description | 
|---|---|
| Color | 
Pink
Represents a 
Declaration
public static readonly Color PinkField Value
| Type | Description | 
|---|---|
| Color | 
Plum
Represents a 
Declaration
public static readonly Color PlumField Value
| Type | Description | 
|---|---|
| Color | 
PowderBlue
Represents a 
Declaration
public static readonly Color PowderBlueField Value
| Type | Description | 
|---|---|
| Color | 
Purple
Represents a 
Declaration
public static readonly Color PurpleField Value
| Type | Description | 
|---|---|
| Color | 
RebeccaPurple
Represents a 
Declaration
public static readonly Color RebeccaPurpleField Value
| Type | Description | 
|---|---|
| Color | 
Red
Represents a 
Declaration
public static readonly Color RedField Value
| Type | Description | 
|---|---|
| Color | 
RosyBrown
Represents a 
Declaration
public static readonly Color RosyBrownField Value
| Type | Description | 
|---|---|
| Color | 
RoyalBlue
Represents a 
Declaration
public static readonly Color RoyalBlueField Value
| Type | Description | 
|---|---|
| Color | 
SaddleBrown
Represents a 
Declaration
public static readonly Color SaddleBrownField Value
| Type | Description | 
|---|---|
| Color | 
Salmon
Represents a 
Declaration
public static readonly Color SalmonField Value
| Type | Description | 
|---|---|
| Color | 
SandyBrown
Represents a 
Declaration
public static readonly Color SandyBrownField Value
| Type | Description | 
|---|---|
| Color | 
SeaGreen
Represents a 
Declaration
public static readonly Color SeaGreenField Value
| Type | Description | 
|---|---|
| Color | 
SeaShell
Represents a 
Declaration
public static readonly Color SeaShellField Value
| Type | Description | 
|---|---|
| Color | 
Sienna
Represents a 
Declaration
public static readonly Color SiennaField Value
| Type | Description | 
|---|---|
| Color | 
Silver
Represents a 
Declaration
public static readonly Color SilverField Value
| Type | Description | 
|---|---|
| Color | 
SkyBlue
Represents a 
Declaration
public static readonly Color SkyBlueField Value
| Type | Description | 
|---|---|
| Color | 
SlateBlue
Represents a 
Declaration
public static readonly Color SlateBlueField Value
| Type | Description | 
|---|---|
| Color | 
SlateGray
Represents a 
Declaration
public static readonly Color SlateGrayField Value
| Type | Description | 
|---|---|
| Color | 
SlateGrey
Represents a 
Declaration
public static readonly Color SlateGreyField Value
| Type | Description | 
|---|---|
| Color | 
Snow
Represents a 
Declaration
public static readonly Color SnowField Value
| Type | Description | 
|---|---|
| Color | 
SpringGreen
Represents a 
Declaration
public static readonly Color SpringGreenField Value
| Type | Description | 
|---|---|
| Color | 
SteelBlue
Represents a 
Declaration
public static readonly Color SteelBlueField Value
| Type | Description | 
|---|---|
| Color | 
Tan
Represents a 
Declaration
public static readonly Color TanField Value
| Type | Description | 
|---|---|
| Color | 
Teal
Represents a 
Declaration
public static readonly Color TealField Value
| Type | Description | 
|---|---|
| Color | 
Thistle
Represents a 
Declaration
public static readonly Color ThistleField Value
| Type | Description | 
|---|---|
| Color | 
Tomato
Represents a 
Declaration
public static readonly Color TomatoField Value
| Type | Description | 
|---|---|
| Color | 
Transparent
Represents a 
Declaration
public static readonly Color TransparentField Value
| Type | Description | 
|---|---|
| Color | 
Turquoise
Represents a 
Declaration
public static readonly Color TurquoiseField Value
| Type | Description | 
|---|---|
| Color | 
Violet
Represents a 
Declaration
public static readonly Color VioletField Value
| Type | Description | 
|---|---|
| Color | 
Wheat
Represents a 
Declaration
public static readonly Color WheatField Value
| Type | Description | 
|---|---|
| Color | 
White
Represents a 
Declaration
public static readonly Color WhiteField Value
| Type | Description | 
|---|---|
| Color | 
WhiteSmoke
Represents a 
Declaration
public static readonly Color WhiteSmokeField Value
| Type | Description | 
|---|---|
| Color | 
Yellow
Represents a 
Declaration
public static readonly Color YellowField Value
| Type | Description | 
|---|---|
| Color | 
YellowGreen
Represents a 
Declaration
public static readonly Color YellowGreenField Value
| Type | Description | 
|---|---|
| Color | 
Properties
| Improve this Doc View SourceWebSafePalette
Gets a collection of named, web safe colors as defined in the CSS Color Module Level 4.
Declaration
public static readonly ReadOnlyMemory<Color> WebSafePalette { get; }Property Value
| Type | Description | 
|---|---|
| ReadOnlyMemory<Color> | 
WernerPalette
Gets a collection of colors as defined in the original second edition of Werner’s Nomenclature of Colours 1821. The hex codes were collected and defined by Nicholas Rougeux https://www.c82.net/werner.
Declaration
public static readonly ReadOnlyMemory<Color> WernerPalette { get; }Property Value
| Type | Description | 
|---|---|
| ReadOnlyMemory<Color> | 
Methods
| Improve this Doc View SourceEquals(Color)
Declaration
public readonly bool Equals(Color other)Parameters
| Type | Name | Description | 
|---|---|---|
| Color | other | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
Equals(Object)
Declaration
public override readonly bool Equals(object obj)Parameters
| Type | Name | Description | 
|---|---|---|
| Object | obj | 
Returns
| Type | Description | 
|---|---|
| Boolean | 
Overrides
| Improve this Doc View SourceFromPixel<TPixel>(TPixel)
Creates a Color from the given TPixel.
Declaration
public static Color FromPixel<TPixel>(TPixel pixel)
    where TPixel : struct, IPixel<TPixel>Parameters
| Type | Name | Description | 
|---|---|---|
| TPixel | pixel | The pixel to convert from. | 
Returns
| Type | Description | 
|---|---|
| Color | The Color. | 
Type Parameters
| Name | Description | 
|---|---|
| TPixel | The pixel format. | 
FromRgb(Byte, Byte, Byte)
Creates a Color from RGB bytes.
Declaration
public static Color FromRgb(byte r, byte g, byte b)Parameters
| Type | Name | Description | 
|---|---|---|
| Byte | r | The red component (0-255). | 
| Byte | g | The green component (0-255). | 
| Byte | b | The blue component (0-255). | 
Returns
| Type | Description | 
|---|---|
| Color | The Color. | 
FromRgba(Byte, Byte, Byte, Byte)
Creates a Color from RGBA bytes.
Declaration
public static Color FromRgba(byte r, byte g, byte b, byte a)Parameters
| Type | Name | Description | 
|---|---|---|
| Byte | r | The red component (0-255). | 
| Byte | g | The green component (0-255). | 
| Byte | b | The blue component (0-255). | 
| Byte | a | The alpha component (0-255). | 
Returns
| Type | Description | 
|---|---|
| Color | The Color. | 
GetHashCode()
Declaration
public override readonly int GetHashCode()Returns
| Type | Description | 
|---|---|
| Int32 | 
Overrides
| Improve this Doc View SourceParse(String)
Creates a new instance of the Color struct from the given input string.
Declaration
public static Color Parse(string input)Parameters
| Type | Name | Description | 
|---|---|---|
| String | input | The name of the color or the hexadecimal representation of the combined color components arranged in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. | 
Returns
| Type | Description | 
|---|---|
| Color | The Color. | 
ParseHex(String)
Creates a new instance of the Color struct from the given hexadecimal string.
Declaration
public static Color ParseHex(string hex)Parameters
| Type | Name | Description | 
|---|---|---|
| String | hex | The hexadecimal representation of the combined color components arranged in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. | 
Returns
| Type | Description | 
|---|---|
| Color | The Color. | 
ToHex()
Gets the hexadecimal representation of the color instance in rrggbbaa form.
Declaration
public readonly string ToHex()Returns
| Type | Description | 
|---|---|
| String | A hexadecimal string representation of the value. | 
ToPixel<TPixel>()
Converts the color instance to a specified TPixel type.
Declaration
public readonly TPixel ToPixel<TPixel>()
    where TPixel : struct, IPixel<TPixel>Returns
| Type | Description | 
|---|---|
| TPixel | The pixel value. | 
Type Parameters
| Name | Description | 
|---|---|
| TPixel | The pixel type to convert to. | 
ToPixel<TPixel>(Configuration, ReadOnlySpan<Color>, Span<TPixel>)
Bulk converts a span of Color to a span of a specified TPixel type.
Declaration
public static void ToPixel<TPixel>(Configuration configuration, ReadOnlySpan<Color> source, Span<TPixel> destination)
    where TPixel : struct, IPixel<TPixel>Parameters
| Type | Name | Description | 
|---|---|---|
| Configuration | configuration | The configuration. | 
| ReadOnlySpan<Color> | source | The source color span. | 
| Span<TPixel> | destination | The destination pixel span. | 
Type Parameters
| Name | Description | 
|---|---|
| TPixel | The pixel type to convert to. | 
ToString()
Declaration
public override readonly string ToString()Returns
| Type | Description | 
|---|---|
| String | 
Overrides
| Improve this Doc View SourceTryParse(String, out Color)
Attempts to creates a new instance of the Color struct from the given input string.
Declaration
public static bool TryParse(string input, out Color result)Parameters
| Type | Name | Description | 
|---|---|---|
| String | input | The name of the color or the hexadecimal representation of the combined color components arranged in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. | 
| Color | result | When this method returns, contains the Color equivalent of the hexadecimal input. | 
Returns
| Type | Description | 
|---|---|
| Boolean | The Boolean. | 
TryParseHex(String, out Color)
Attempts to creates a new instance of the Color struct from the given hexadecimal string.
Declaration
public static bool TryParseHex(string hex, out Color result)Parameters
| Type | Name | Description | 
|---|---|---|
| String | hex | The hexadecimal representation of the combined color components arranged in rgb, rgba, rrggbb, or rrggbbaa format to match web syntax. | 
| Color | result | When this method returns, contains the Color equivalent of the hexadecimal input. | 
Returns
| Type | Description | 
|---|---|
| Boolean | The Boolean. | 
WithAlpha(Single)
Alters the alpha channel of the color, returning a new instance.
Declaration
public readonly Color WithAlpha(float alpha)Parameters
| Type | Name | Description | 
|---|---|---|
| Single | alpha | The new value of alpha [0..1]. | 
Returns
| Type | Description | 
|---|---|
| Color | The color having it's alpha channel altered. | 
Operators
| Improve this Doc View SourceEquality(Color, Color)
Checks whether two Color structures are equal.
Declaration
public static bool operator ==(Color left, Color right)Parameters
| Type | Name | Description | 
|---|---|---|
| Color | left | The left hand Color operand. | 
| Color | right | The right hand Color operand. | 
Returns
| Type | Description | 
|---|---|
| Boolean | True if the  | 
Explicit(Color to Vector4)
Declaration
public static explicit operator Vector4(Color color)Parameters
| Type | Name | Description | 
|---|---|---|
| Color | color | The Color. | 
Returns
| Type | Description | 
|---|---|
| Vector4 | The Vector4. | 
Explicit(Vector4 to Color)
Declaration
public static explicit operator Color(Vector4 source)Parameters
| Type | Name | Description | 
|---|---|---|
| Vector4 | source | The Vector4. | 
Returns
| Type | Description | 
|---|---|
| Color | The Color. | 
Inequality(Color, Color)
Checks whether two Color structures are not equal.
Declaration
public static bool operator !=(Color left, Color right)Parameters
| Type | Name | Description | 
|---|---|---|
| Color | left | The left hand Color operand. | 
| Color | right | The right hand Color operand. | 
Returns
| Type | Description | 
|---|---|
| Boolean | True if the  |