Struct Color
Represents a 32-bit color.
Implements
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public struct Color : IEquatable<Color>
Constructors
Color(Byte)
Initializes a new instance of the Color struct.
Declaration
public Color(byte v)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | v | Grayscale tone. |
Color(Byte, Byte, Byte, Byte)
Initializes a new instance of the Color struct.
Declaration
public Color(byte r, byte g, byte b, byte a = null)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | r | Red component. |
System.Byte | g | Green component. |
System.Byte | b | Blue component. |
System.Byte | a | Alpha component. |
Color(Single)
Initializes a new instance of the Color struct.
Declaration
public Color(float v)
Parameters
Type | Name | Description |
---|---|---|
System.Single | v | Grayscale tone in the [0, 1] range. |
Color(Single, Single, Single, Single)
Initializes a new instance of the Color struct.
Declaration
public Color(float r, float g, float b, float a = 1F)
Parameters
Type | Name | Description |
---|---|---|
System.Single | r | Red component in the [0, 1] range. |
System.Single | g | Green component in the [0, 1] range. |
System.Single | b | Blue component in the [0, 1] range. |
System.Single | a | Alpha component in the [0, 1] range. |
Color(String)
Initializes a new instance of the Color struct.
Declaration
public Color(string hex)
Parameters
Type | Name | Description |
---|---|---|
System.String | hex | hexadecimal color code. |
Color(UInt32)
Initializes a new instance of the Color struct.
Declaration
public Color(uint packetValue)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | packetValue | The packet value. |
Fields
A
Alpha component.
Declaration
public byte A
Field Value
Type | Description |
---|---|
System.Byte |
B
Blue component.
Declaration
public byte B
Field Value
Type | Description |
---|---|
System.Byte |
G
Green component.
Declaration
public byte G
Field Value
Type | Description |
---|---|
System.Byte |
R
Red component.
Declaration
public byte R
Field Value
Type | Description |
---|---|
System.Byte |
Properties
AliceBlue
Gets the alice blue.
Declaration
public static readonly Color AliceBlue { get; }
Property Value
Type | Description |
---|---|
Color |
AntiqueWhite
Gets the antique white.
Declaration
public static readonly Color AntiqueWhite { get; }
Property Value
Type | Description |
---|---|
Color |
Aqua
Gets the aqua.
Declaration
public static readonly Color Aqua { get; }
Property Value
Type | Description |
---|---|
Color |
Aquamarine
Gets the aquamarine.
Declaration
public static readonly Color Aquamarine { get; }
Property Value
Type | Description |
---|---|
Color |
Azure
Gets the azure.
Declaration
public static readonly Color Azure { get; }
Property Value
Type | Description |
---|---|
Color |
Beige
Gets the beige.
Declaration
public static readonly Color Beige { get; }
Property Value
Type | Description |
---|---|
Color |
Bisque
Gets the bisque.
Declaration
public static readonly Color Bisque { get; }
Property Value
Type | Description |
---|---|
Color |
Black
Gets the black.
Declaration
public static readonly Color Black { get; }
Property Value
Type | Description |
---|---|
Color |
BlanchedAlmond
Gets the blanched almond.
Declaration
public static readonly Color BlanchedAlmond { get; }
Property Value
Type | Description |
---|---|
Color |
Blue
Gets the blue.
Declaration
public static readonly Color Blue { get; }
Property Value
Type | Description |
---|---|
Color |
BlueViolet
Gets the blue violet.
Declaration
public static readonly Color BlueViolet { get; }
Property Value
Type | Description |
---|---|
Color |
Brown
Gets the brown.
Declaration
public static readonly Color Brown { get; }
Property Value
Type | Description |
---|---|
Color |
BurlyWood
Gets the burly wood.
Declaration
public static readonly Color BurlyWood { get; }
Property Value
Type | Description |
---|---|
Color |
CadetBlue
Gets the cadet blue.
Declaration
public static readonly Color CadetBlue { get; }
Property Value
Type | Description |
---|---|
Color |
Chartreuse
Gets the chartreuse.
Declaration
public static readonly Color Chartreuse { get; }
Property Value
Type | Description |
---|---|
Color |
Chocolate
Gets the chocolate.
Declaration
public static readonly Color Chocolate { get; }
Property Value
Type | Description |
---|---|
Color |
Coral
Gets the coral.
Declaration
public static readonly Color Coral { get; }
Property Value
Type | Description |
---|---|
Color |
CornflowerBlue
Gets the cornflower blue.
Declaration
public static readonly Color CornflowerBlue { get; }
Property Value
Type | Description |
---|---|
Color |
Cornsilk
Gets the cornsilk.
Declaration
public static readonly Color Cornsilk { get; }
Property Value
Type | Description |
---|---|
Color |
Crimson
Gets the crimson.
Declaration
public static readonly Color Crimson { get; }
Property Value
Type | Description |
---|---|
Color |
Cyan
Gets the cyan.
Declaration
public static readonly Color Cyan { get; }
Property Value
Type | Description |
---|---|
Color |
DarkBlue
Gets the dark blue.
Declaration
public static readonly Color DarkBlue { get; }
Property Value
Type | Description |
---|---|
Color |
DarkCyan
Gets the dark cyan.
Declaration
public static readonly Color DarkCyan { get; }
Property Value
Type | Description |
---|---|
Color |
DarkGoldenrod
Gets the dark goldenrod.
Declaration
public static readonly Color DarkGoldenrod { get; }
Property Value
Type | Description |
---|---|
Color |
DarkGray
Gets the dark gray.
Declaration
public static readonly Color DarkGray { get; }
Property Value
Type | Description |
---|---|
Color |
DarkGreen
Gets the dark green.
Declaration
public static readonly Color DarkGreen { get; }
Property Value
Type | Description |
---|---|
Color |
DarkKhaki
Gets the dark khaki.
Declaration
public static readonly Color DarkKhaki { get; }
Property Value
Type | Description |
---|---|
Color |
DarkMagenta
Gets the dark magenta.
Declaration
public static readonly Color DarkMagenta { get; }
Property Value
Type | Description |
---|---|
Color |
DarkOliveGreen
Gets the dark olive green.
Declaration
public static readonly Color DarkOliveGreen { get; }
Property Value
Type | Description |
---|---|
Color |
DarkOrange
Gets the dark orange.
Declaration
public static readonly Color DarkOrange { get; }
Property Value
Type | Description |
---|---|
Color |
DarkOrchid
Gets the dark orchid.
Declaration
public static readonly Color DarkOrchid { get; }
Property Value
Type | Description |
---|---|
Color |
DarkRed
Gets the dark red.
Declaration
public static readonly Color DarkRed { get; }
Property Value
Type | Description |
---|---|
Color |
DarkSalmon
Gets the dark salmon.
Declaration
public static readonly Color DarkSalmon { get; }
Property Value
Type | Description |
---|---|
Color |
DarkSeaGreen
Gets the dark sea green.
Declaration
public static readonly Color DarkSeaGreen { get; }
Property Value
Type | Description |
---|---|
Color |
DarkSlateBlue
Gets the dark slate blue.
Declaration
public static readonly Color DarkSlateBlue { get; }
Property Value
Type | Description |
---|---|
Color |
DarkSlateGray
Gets the dark slate gray.
Declaration
public static readonly Color DarkSlateGray { get; }
Property Value
Type | Description |
---|---|
Color |
DarkTurquoise
Gets the dark turquoise.
Declaration
public static readonly Color DarkTurquoise { get; }
Property Value
Type | Description |
---|---|
Color |
DarkViolet
Gets the dark violet.
Declaration
public static readonly Color DarkViolet { get; }
Property Value
Type | Description |
---|---|
Color |
DeepPink
Gets the deep pink.
Declaration
public static readonly Color DeepPink { get; }
Property Value
Type | Description |
---|---|
Color |
DeepSkyBlue
Gets the deep sky blue.
Declaration
public static readonly Color DeepSkyBlue { get; }
Property Value
Type | Description |
---|---|
Color |
DimGray
Gets the dim gray.
Declaration
public static readonly Color DimGray { get; }
Property Value
Type | Description |
---|---|
Color |
DodgerBlue
Gets the dodger blue.
Declaration
public static readonly Color DodgerBlue { get; }
Property Value
Type | Description |
---|---|
Color |
Firebrick
Gets the firebrick.
Declaration
public static readonly Color Firebrick { get; }
Property Value
Type | Description |
---|---|
Color |
FloralWhite
Gets the floral white.
Declaration
public static readonly Color FloralWhite { get; }
Property Value
Type | Description |
---|---|
Color |
ForestGreen
Gets the forest green.
Declaration
public static readonly Color ForestGreen { get; }
Property Value
Type | Description |
---|---|
Color |
Fuchsia
Gets the fuchsia.
Declaration
public static readonly Color Fuchsia { get; }
Property Value
Type | Description |
---|---|
Color |
Gainsboro
Gets the gainsboro.
Declaration
public static readonly Color Gainsboro { get; }
Property Value
Type | Description |
---|---|
Color |
GhostWhite
Gets the ghost white.
Declaration
public static readonly Color GhostWhite { get; }
Property Value
Type | Description |
---|---|
Color |
Gold
Gets the gold.
Declaration
public static readonly Color Gold { get; }
Property Value
Type | Description |
---|---|
Color |
Goldenrod
Gets the goldenrod.
Declaration
public static readonly Color Goldenrod { get; }
Property Value
Type | Description |
---|---|
Color |
Gray
Gets the gray.
Declaration
public static readonly Color Gray { get; }
Property Value
Type | Description |
---|---|
Color |
Green
Gets the green.
Declaration
public static readonly Color Green { get; }
Property Value
Type | Description |
---|---|
Color |
GreenYellow
Gets the green yellow.
Declaration
public static readonly Color GreenYellow { get; }
Property Value
Type | Description |
---|---|
Color |
Honeydew
Gets the honeydew.
Declaration
public static readonly Color Honeydew { get; }
Property Value
Type | Description |
---|---|
Color |
HotPink
Gets the hot pink.
Declaration
public static readonly Color HotPink { get; }
Property Value
Type | Description |
---|---|
Color |
IndianRed
Gets the indian red.
Declaration
public static readonly Color IndianRed { get; }
Property Value
Type | Description |
---|---|
Color |
Indigo
Gets the indigo.
Declaration
public static readonly Color Indigo { get; }
Property Value
Type | Description |
---|---|
Color |
InherentColor
Gets the inherent color, discarding its luminance.
Declaration
public readonly Color InherentColor { get; }
Property Value
Type | Description |
---|---|
Color |
Item[Int32]
Gets or sets the
Declaration
public byte this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Element index. |
Property Value
Type | Description |
---|---|
System.Byte | The result. |
Ivory
Gets the ivory.
Declaration
public static readonly Color Ivory { get; }
Property Value
Type | Description |
---|---|
Color |
Khaki
Gets the khaki.
Declaration
public static readonly Color Khaki { get; }
Property Value
Type | Description |
---|---|
Color |
Lavender
Gets the lavender.
Declaration
public static readonly Color Lavender { get; }
Property Value
Type | Description |
---|---|
Color |
LavenderBlush
Gets the lavender blush.
Declaration
public static readonly Color LavenderBlush { get; }
Property Value
Type | Description |
---|---|
Color |
LawnGreen
Gets the lawn green.
Declaration
public static readonly Color LawnGreen { get; }
Property Value
Type | Description |
---|---|
Color |
LemonChiffon
Gets the lemon chiffon.
Declaration
public static readonly Color LemonChiffon { get; }
Property Value
Type | Description |
---|---|
Color |
LightBlue
Gets the light blue.
Declaration
public static readonly Color LightBlue { get; }
Property Value
Type | Description |
---|---|
Color |
LightCoral
Gets the light coral.
Declaration
public static readonly Color LightCoral { get; }
Property Value
Type | Description |
---|---|
Color |
LightCyan
Gets the light cyan.
Declaration
public static readonly Color LightCyan { get; }
Property Value
Type | Description |
---|---|
Color |
LightGoldenrodYellow
Gets the light goldenrod yellow.
Declaration
public static readonly Color LightGoldenrodYellow { get; }
Property Value
Type | Description |
---|---|
Color |
LightGray
Gets the light gray.
Declaration
public static readonly Color LightGray { get; }
Property Value
Type | Description |
---|---|
Color |
LightGreen
Gets the light green.
Declaration
public static readonly Color LightGreen { get; }
Property Value
Type | Description |
---|---|
Color |
LightPink
Gets the light pink.
Declaration
public static readonly Color LightPink { get; }
Property Value
Type | Description |
---|---|
Color |
LightSalmon
Gets the light salmon.
Declaration
public static readonly Color LightSalmon { get; }
Property Value
Type | Description |
---|---|
Color |
LightSeaGreen
Gets the light sea green.
Declaration
public static readonly Color LightSeaGreen { get; }
Property Value
Type | Description |
---|---|
Color |
LightSkyBlue
Gets the light sky blue.
Declaration
public static readonly Color LightSkyBlue { get; }
Property Value
Type | Description |
---|---|
Color |
LightSlateGray
Gets the light slate gray.
Declaration
public static readonly Color LightSlateGray { get; }
Property Value
Type | Description |
---|---|
Color |
LightSteelBlue
Gets the light steel blue.
Declaration
public static readonly Color LightSteelBlue { get; }
Property Value
Type | Description |
---|---|
Color |
LightYellow
Gets the light yellow.
Declaration
public static readonly Color LightYellow { get; }
Property Value
Type | Description |
---|---|
Color |
Lime
Gets the lime.
Declaration
public static readonly Color Lime { get; }
Property Value
Type | Description |
---|---|
Color |
LimeGreen
Gets the lime green.
Declaration
public static readonly Color LimeGreen { get; }
Property Value
Type | Description |
---|---|
Color |
Linen
Gets the linen.
Declaration
public static readonly Color Linen { get; }
Property Value
Type | Description |
---|---|
Color |
Luminance
Gets the color luminance.
Declaration
public readonly float Luminance { get; }
Property Value
Type | Description |
---|---|
System.Single |
Magenta
Gets the magenta.
Declaration
public static readonly Color Magenta { get; }
Property Value
Type | Description |
---|---|
Color |
Maroon
Gets the maroon.
Declaration
public static readonly Color Maroon { get; }
Property Value
Type | Description |
---|---|
Color |
MediumAquamarine
Gets the medium aquamarine.
Declaration
public static readonly Color MediumAquamarine { get; }
Property Value
Type | Description |
---|---|
Color |
MediumBlue
Gets the medium blue.
Declaration
public static readonly Color MediumBlue { get; }
Property Value
Type | Description |
---|---|
Color |
MediumOrchid
Gets the medium orchid.
Declaration
public static readonly Color MediumOrchid { get; }
Property Value
Type | Description |
---|---|
Color |
MediumPurple
Gets the medium purple.
Declaration
public static readonly Color MediumPurple { get; }
Property Value
Type | Description |
---|---|
Color |
MediumSeaGreen
Gets the medium sea green.
Declaration
public static readonly Color MediumSeaGreen { get; }
Property Value
Type | Description |
---|---|
Color |
MediumSlateBlue
Gets the medium slate blue.
Declaration
public static readonly Color MediumSlateBlue { get; }
Property Value
Type | Description |
---|---|
Color |
MediumSpringGreen
Gets the medium spring green.
Declaration
public static readonly Color MediumSpringGreen { get; }
Property Value
Type | Description |
---|---|
Color |
MediumTurquoise
Gets the medium turquoise.
Declaration
public static readonly Color MediumTurquoise { get; }
Property Value
Type | Description |
---|---|
Color |
MediumVioletRed
Gets the medium violet red.
Declaration
public static readonly Color MediumVioletRed { get; }
Property Value
Type | Description |
---|---|
Color |
MidnightBlue
Gets the midnight blue.
Declaration
public static readonly Color MidnightBlue { get; }
Property Value
Type | Description |
---|---|
Color |
MintCream
Gets the mint cream.
Declaration
public static readonly Color MintCream { get; }
Property Value
Type | Description |
---|---|
Color |
MistyRose
Gets the misty rose.
Declaration
public static readonly Color MistyRose { get; }
Property Value
Type | Description |
---|---|
Color |
Moccasin
Gets the moccasin.
Declaration
public static readonly Color Moccasin { get; }
Property Value
Type | Description |
---|---|
Color |
NavajoWhite
Gets the navajo white.
Declaration
public static readonly Color NavajoWhite { get; }
Property Value
Type | Description |
---|---|
Color |
Navy
Gets the navy.
Declaration
public static readonly Color Navy { get; }
Property Value
Type | Description |
---|---|
Color |
OldLace
Gets the old lace.
Declaration
public static readonly Color OldLace { get; }
Property Value
Type | Description |
---|---|
Color |
Olive
Gets the olive.
Declaration
public static readonly Color Olive { get; }
Property Value
Type | Description |
---|---|
Color |
OliveDrab
Gets the olive drab.
Declaration
public static readonly Color OliveDrab { get; }
Property Value
Type | Description |
---|---|
Color |
Orange
Gets the orange.
Declaration
public static readonly Color Orange { get; }
Property Value
Type | Description |
---|---|
Color |
OrangeRed
Gets the orange red.
Declaration
public static readonly Color OrangeRed { get; }
Property Value
Type | Description |
---|---|
Color |
Orchid
Gets the orchid.
Declaration
public static readonly Color Orchid { get; }
Property Value
Type | Description |
---|---|
Color |
PaleGoldenrod
Gets the pale goldenrod.
Declaration
public static readonly Color PaleGoldenrod { get; }
Property Value
Type | Description |
---|---|
Color |
PaleGreen
Gets the pale green.
Declaration
public static readonly Color PaleGreen { get; }
Property Value
Type | Description |
---|---|
Color |
PaleTurquoise
Gets the pale turquoise.
Declaration
public static readonly Color PaleTurquoise { get; }
Property Value
Type | Description |
---|---|
Color |
PaleVioletRed
Gets the pale violet red.
Declaration
public static readonly Color PaleVioletRed { get; }
Property Value
Type | Description |
---|---|
Color |
PapayaWhip
Gets the papaya whip.
Declaration
public static readonly Color PapayaWhip { get; }
Property Value
Type | Description |
---|---|
Color |
PeachPuff
Gets the peach puff.
Declaration
public static readonly Color PeachPuff { get; }
Property Value
Type | Description |
---|---|
Color |
Peru
Gets the peru.
Declaration
public static readonly Color Peru { get; }
Property Value
Type | Description |
---|---|
Color |
Pink
Gets the pink.
Declaration
public static readonly Color Pink { get; }
Property Value
Type | Description |
---|---|
Color |
Plum
Gets the plum.
Declaration
public static readonly Color Plum { get; }
Property Value
Type | Description |
---|---|
Color |
PowderBlue
Gets the powder blue.
Declaration
public static readonly Color PowderBlue { get; }
Property Value
Type | Description |
---|---|
Color |
Purple
Gets the purple.
Declaration
public static readonly Color Purple { get; }
Property Value
Type | Description |
---|---|
Color |
Red
Gets the red.
Declaration
public static readonly Color Red { get; }
Property Value
Type | Description |
---|---|
Color |
RosyBrown
Gets the rosy brown.
Declaration
public static readonly Color RosyBrown { get; }
Property Value
Type | Description |
---|---|
Color |
RoyalBlue
Gets the royal blue.
Declaration
public static readonly Color RoyalBlue { get; }
Property Value
Type | Description |
---|---|
Color |
SaddleBrown
Gets the saddle brown.
Declaration
public static readonly Color SaddleBrown { get; }
Property Value
Type | Description |
---|---|
Color |
Salmon
Gets the salmon.
Declaration
public static readonly Color Salmon { get; }
Property Value
Type | Description |
---|---|
Color |
SandyBrown
Gets the sandy brown.
Declaration
public static readonly Color SandyBrown { get; }
Property Value
Type | Description |
---|---|
Color |
SeaGreen
Gets the sea green.
Declaration
public static readonly Color SeaGreen { get; }
Property Value
Type | Description |
---|---|
Color |
SeaShell
Gets the sea shell.
Declaration
public static readonly Color SeaShell { get; }
Property Value
Type | Description |
---|---|
Color |
Sienna
Gets the sienna.
Declaration
public static readonly Color Sienna { get; }
Property Value
Type | Description |
---|---|
Color |
Silver
Gets the silver.
Declaration
public static readonly Color Silver { get; }
Property Value
Type | Description |
---|---|
Color |
SkyBlue
Gets the sky blue.
Declaration
public static readonly Color SkyBlue { get; }
Property Value
Type | Description |
---|---|
Color |
SlateBlue
Gets the slate blue.
Declaration
public static readonly Color SlateBlue { get; }
Property Value
Type | Description |
---|---|
Color |
SlateGray
Gets the slate gray.
Declaration
public static readonly Color SlateGray { get; }
Property Value
Type | Description |
---|---|
Color |
Snow
Gets the snow.
Declaration
public static readonly Color Snow { get; }
Property Value
Type | Description |
---|---|
Color |
SpringGreen
Gets the spring green.
Declaration
public static readonly Color SpringGreen { get; }
Property Value
Type | Description |
---|---|
Color |
SteelBlue
Gets the steel blue.
Declaration
public static readonly Color SteelBlue { get; }
Property Value
Type | Description |
---|---|
Color |
Tan
Gets the tan.
Declaration
public static readonly Color Tan { get; }
Property Value
Type | Description |
---|---|
Color |
Teal
Gets the teal.
Declaration
public static readonly Color Teal { get; }
Property Value
Type | Description |
---|---|
Color |
Thistle
Gets the thistle.
Declaration
public static readonly Color Thistle { get; }
Property Value
Type | Description |
---|---|
Color |
Tomato
Gets the tomato.
Declaration
public static readonly Color Tomato { get; }
Property Value
Type | Description |
---|---|
Color |
Transparent
Gets the transparent.
Declaration
public static readonly Color Transparent { get; }
Property Value
Type | Description |
---|---|
Color |
Turquoise
Gets the turquoise.
Declaration
public static readonly Color Turquoise { get; }
Property Value
Type | Description |
---|---|
Color |
Violet
Gets the violet.
Declaration
public static readonly Color Violet { get; }
Property Value
Type | Description |
---|---|
Color |
Wheat
Gets the wheat.
Declaration
public static readonly Color Wheat { get; }
Property Value
Type | Description |
---|---|
Color |
White
Gets the white.
Declaration
public static readonly Color White { get; }
Property Value
Type | Description |
---|---|
Color |
WhiteSmoke
Gets the white smoke.
Declaration
public static readonly Color WhiteSmoke { get; }
Property Value
Type | Description |
---|---|
Color |
Yellow
Gets the yellow.
Declaration
public static readonly Color Yellow { get; }
Property Value
Type | Description |
---|---|
Color |
YellowGreen
Gets the yellow green.
Declaration
public static readonly Color YellowGreen { get; }
Property Value
Type | Description |
---|---|
Color |
Methods
Equals(Color)
Equalses the specified other.
Declaration
public bool Equals(Color other)
Parameters
Type | Name | Description |
---|---|---|
Color | other | The other. |
Returns
Type | Description |
---|---|
System.Boolean | The result. |
Equals(Object)
Determines whether the specified
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The |
Returns
Type | Description |
---|---|
System.Boolean |
|
FromHex(String)
Creates a color from Hex coded string.
Declaration
public static Color FromHex(string colorcode)
Parameters
Type | Name | Description |
---|---|---|
System.String | colorcode | Hex format #AARRGGBB or #RRGGBB. |
Returns
Type | Description |
---|---|
Color | An ARGB color. |
FromHsl(Single, Single, Single, Single)
Creates a color from HSL components.
Declaration
public static Color FromHsl(float h, float s, float l, float a = 1F)
Parameters
Type | Name | Description |
---|---|---|
System.Single | h | Hue component in the [0, 1] range. |
System.Single | s | Saturation component in the [0, 1] range. |
System.Single | l | Luminance component in the [0, 1] range. |
System.Single | a | Alpha component in the [0, 1] range. |
Returns
Type | Description |
---|---|
Color | An ARGB color. |
FromHsv(Single, Single, Single, Single)
Creates a color from HSV components.
Declaration
public static Color FromHsv(float h, float s, float v, float a = 1F)
Parameters
Type | Name | Description |
---|---|---|
System.Single | h | Hue component in the [0, 1] range. |
System.Single | s | Saturation component in the [0, 1] range. |
System.Single | v | Value component in the [0, 1] range. |
System.Single | a | Alpha component in the [0, 1] range. |
Returns
Type | Description |
---|---|
Color | An ARGB color. |
FromVector3(ref Vector3)
Converts Vector3 to Color.
Declaration
public static Color FromVector3(ref Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | Vector3 with color. |
Returns
Type | Description |
---|---|
Color | The color. |
FromVector3(ref Vector4, out Color)
Converts Vector4 to Color.
Declaration
public static void FromVector3(ref Vector4 vector, out Color color)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | vector | Vector3 with color. |
Color | color | The color. |
FromVector4(ref Vector4)
Converts Vector4 to Color.
Declaration
public static Color FromVector4(ref Vector4 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | vector | Vector4 with color. |
Returns
Type | Description |
---|---|
Color | The color. |
FromVector4(ref Vector4, out Color)
Converts Vector4 to Color.
Declaration
public static void FromVector4(ref Vector4 vector, out Color color)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | vector | Vector4 with color. |
Color | color | The color. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Lerp(Color, Color, Single)
Lerps the specified value1.
Declaration
public static Color Lerp(Color value1, Color value2, float amount)
Parameters
Type | Name | Description |
---|---|---|
Color | value1 | The value1. |
Color | value2 | The value2. |
System.Single | amount | The amount. |
Returns
Type | Description |
---|---|
Color | The result. |
Lerp(ref Color, ref Color, Single)
Lerps the specified value1.
Declaration
public static Color Lerp(ref Color value1, ref Color value2, float amount)
Parameters
Type | Name | Description |
---|---|---|
Color | value1 | The value1. |
Color | value2 | The value2. |
System.Single | amount | The amount. |
Returns
Type | Description |
---|---|
Color | The result. |
ToHexColorCode()
To the hexadecimal code.
Declaration
public string ToHexColorCode()
Returns
Type | Description |
---|---|
System.String | Color as hexadecimal code with the format #RGBA. |
ToInt()
To int value.
Declaration
public int ToInt()
Returns
Type | Description |
---|---|
System.Int32 | Color as int value. |
ToVector3()
Converts to a Vector3.
Declaration
public Vector3 ToVector3()
Returns
Type | Description |
---|---|
Vector3 | Color as a Vector3. |
ToVector3(ref Vector3)
Converts to a Vector3.
Declaration
public void ToVector3(ref Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | Color as a Vector3. |
ToVector4()
Converts to a Vector4.
Declaration
public Vector4 ToVector4()
Returns
Type | Description |
---|---|
Vector4 | Color as a Vector4. |
ToVector4(out Vector4)
Converts to a Vector4.
Declaration
public void ToVector4(out Vector4 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | vector | Color as a Vector4. |
Operators
Addition(Color, Color)
Implements the operator +.
Declaration
public static Color operator +(Color a, Color b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | First color. |
Color | b | Second color. |
Returns
Type | Description |
---|---|
Color | The result of the operator. |
Division(Color, Single)
Implements the operator /.
Declaration
public static Color operator /(Color a, float b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | First color. |
System.Single | b | Second color. |
Returns
Type | Description |
---|---|
Color | The result of the operator. |
Equality(Color, Color)
Implements the operator ==.
Declaration
public static bool operator ==(Color lhs, Color rhs)
Parameters
Type | Name | Description |
---|---|---|
Color | lhs | The LHS. |
Color | rhs | The RHS. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
Inequality(Color, Color)
Implements the operator !=.
Declaration
public static bool operator !=(Color lhs, Color rhs)
Parameters
Type | Name | Description |
---|---|---|
Color | lhs | The LHS. |
Color | rhs | The RHS. |
Returns
Type | Description |
---|---|
System.Boolean | The result of the operator. |
Multiply(Color, Color)
Implements the operator *.
Declaration
public static Color operator *(Color a, Color b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | First color. |
Color | b | Second color. |
Returns
Type | Description |
---|---|
Color | The result of the operator. |
Multiply(Color, Single)
Implements the operator *.
Declaration
public static Color operator *(Color a, float b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | First color. |
System.Single | b | Second color. |
Returns
Type | Description |
---|---|
Color | The result of the operator. |
Multiply(Single, Color)
Implements the operator *.
Declaration
public static Color operator *(float b, Color a)
Parameters
Type | Name | Description |
---|---|---|
System.Single | b | First color. |
Color | a | Second color. |
Returns
Type | Description |
---|---|
Color | The result of the operator. |
Subtraction(Color, Color)
Implements the operator -.
Declaration
public static Color operator -(Color a, Color b)
Parameters
Type | Name | Description |
---|---|---|
Color | a | First color. |
Color | b | Second color. |
Returns
Type | Description |
---|---|
Color | The result of the operator. |