Struct GorgonColor
An immutable 4 component (Red, Green, Blue, and Alpha) color value.
Inherited Members
Namespace: Gorgon.Graphics
Assembly: Gorgon.Core.dll
Syntax
[Serializable]
public readonly struct GorgonColor : IGorgonEquatableByRef<GorgonColor>, IEquatable<GorgonColor>, ISerializable
Remarks
This value type represents an RGBA (Red, Green, Blue, Alpha) color using a float for each color component.
Primarily this is used in graphical operations and can be converted to a Color value implicitly for use in System.Drawing operations.
Constructors
| Edit this page View SourceGorgonColor(GorgonColor, float)
Initializes a new instance of the GorgonColor struct.
Declaration
public GorgonColor(GorgonColor color, float alpha)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The base GorgonColor. |
float | alpha | The alpha value to assign to the color. |
Remarks
| Edit this page View SourceGorgonColor(Color)
Initializes a new instance of the GorgonColor struct.
Declaration
public GorgonColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | A SharpDX color value. |
GorgonColor(Color)
Initializes a new instance of the GorgonColor struct.
Declaration
public GorgonColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The Color that will be used to generate this GorgonColor. |
GorgonColor(int)
Initializes a new instance of the GorgonColor struct.
Declaration
public GorgonColor(int argb)
Parameters
Type | Name | Description |
---|---|---|
int | argb | An int value representing a color in ARGB format. |
GorgonColor(Vector3)
Initializes a new instance of the GorgonColor struct.
Declaration
public GorgonColor(Vector3 color)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | color | The Vector3 that will be used to generate this GorgonColor. |
Remarks
This will map the Vector3.X, Vector3.Y and Vector3.Z components to the Red, Green and Blue values respectively. The Alpha value is set to 1.0f (opaque) for this conversion.
GorgonColor(Vector4)
Initializes a new instance of the GorgonColor struct.
Declaration
public GorgonColor(Vector4 color)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | color | The Vector4 that will be used to generate this GorgonColor. |
Remarks
This will map the Vector4.X, Vector4.Y, Vector4.Z and Vector4.W components to the Red, Green, Blue and Alpha values respectively.
GorgonColor(float, float, float)
Initializes a new instance of the GorgonColor struct.
Declaration
public GorgonColor(float r, float g, float b)
Parameters
Type | Name | Description |
---|---|---|
float | r | The red component. |
float | g | The green component. |
float | b | The blue component. |
GorgonColor(float, float, float, float)
Initializes a new instance of the GorgonColor struct.
Declaration
public GorgonColor(float r, float g, float b, float a)
Parameters
Type | Name | Description |
---|---|---|
float | r | The red component. |
float | g | The green component. |
float | b | The blue component. |
float | a | The alpha component. |
Fields
| Edit this page View SourceAlpha
The Alpha channel component.
Declaration
public readonly float Alpha
Field Value
Type | Description |
---|---|
float |
Aquamarine
Aquamarine.
Declaration
public static readonly GorgonColor Aquamarine
Field Value
Type | Description |
---|---|
GorgonColor |
Beige
Beige.
Declaration
public static readonly GorgonColor Beige
Field Value
Type | Description |
---|---|
GorgonColor |
Black
The color black.
Declaration
public static readonly GorgonColor Black
Field Value
Type | Description |
---|---|
GorgonColor |
BlackTransparent
A completely transparent color.
Declaration
public static readonly GorgonColor BlackTransparent
Field Value
Type | Description |
---|---|
GorgonColor |
BlanchedAlmond
WhiteSmoke.
Declaration
public static readonly GorgonColor BlanchedAlmond
Field Value
Type | Description |
---|---|
GorgonColor |
Blue
The Blue color channel component.
Declaration
public readonly float Blue
Field Value
Type | Description |
---|---|
float |
BluePure
Pure blue (Red = 0, Green = 0, Blue = 1).
Declaration
public static readonly GorgonColor BluePure
Field Value
Type | Description |
---|---|
GorgonColor |
BlueViolet
BlueViolet.
Declaration
public static readonly GorgonColor BlueViolet
Field Value
Type | Description |
---|---|
GorgonColor |
Brown
Brown.
Declaration
public static readonly GorgonColor Brown
Field Value
Type | Description |
---|---|
GorgonColor |
CadetBlue
CadetBlue.
Declaration
public static readonly GorgonColor CadetBlue
Field Value
Type | Description |
---|---|
GorgonColor |
Chartreuse
Chartreuse.
Declaration
public static readonly GorgonColor Chartreuse
Field Value
Type | Description |
---|---|
GorgonColor |
CornFlowerBlue
Corn flower blue.
Declaration
public static readonly GorgonColor CornFlowerBlue
Field Value
Type | Description |
---|---|
GorgonColor |
Crimson
Crimson.
Declaration
public static readonly GorgonColor Crimson
Field Value
Type | Description |
---|---|
GorgonColor |
CyanPure
Pure cyan (Red = 0, Green = 1, Blue = 1).
Declaration
public static readonly GorgonColor CyanPure
Field Value
Type | Description |
---|---|
GorgonColor |
DarkBlue
Dark blue.
Declaration
public static readonly GorgonColor DarkBlue
Field Value
Type | Description |
---|---|
GorgonColor |
DarkCyan
Dark cyan.
Declaration
public static readonly GorgonColor DarkCyan
Field Value
Type | Description |
---|---|
GorgonColor |
DarkGreen
Dark green.
Declaration
public static readonly GorgonColor DarkGreen
Field Value
Type | Description |
---|---|
GorgonColor |
DarkPurple
Dark purple.
Declaration
public static readonly GorgonColor DarkPurple
Field Value
Type | Description |
---|---|
GorgonColor |
DarkRed
Dark red.
Declaration
public static readonly GorgonColor DarkRed
Field Value
Type | Description |
---|---|
GorgonColor |
DarkYellow
Dark yellow.
Declaration
public static readonly GorgonColor DarkYellow
Field Value
Type | Description |
---|---|
GorgonColor |
DeepPink
DeepPink.
Declaration
public static readonly GorgonColor DeepPink
Field Value
Type | Description |
---|---|
GorgonColor |
DeepSkyBlue
DeepSkyBlue.
Declaration
public static readonly GorgonColor DeepSkyBlue
Field Value
Type | Description |
---|---|
GorgonColor |
Firebrick
Firebrick.
Declaration
public static readonly GorgonColor Firebrick
Field Value
Type | Description |
---|---|
GorgonColor |
Gold
Gold.
Declaration
public static readonly GorgonColor Gold
Field Value
Type | Description |
---|---|
GorgonColor |
Gray10
10% gray.
Declaration
public static readonly GorgonColor Gray10
Field Value
Type | Description |
---|---|
GorgonColor |
Gray20
20% gray.
Declaration
public static readonly GorgonColor Gray20
Field Value
Type | Description |
---|---|
GorgonColor |
Gray25
25% gray.
Declaration
public static readonly GorgonColor Gray25
Field Value
Type | Description |
---|---|
GorgonColor |
Gray30
30% gray.
Declaration
public static readonly GorgonColor Gray30
Field Value
Type | Description |
---|---|
GorgonColor |
Gray40
40% gray.
Declaration
public static readonly GorgonColor Gray40
Field Value
Type | Description |
---|---|
GorgonColor |
Gray50
50% gray.
Declaration
public static readonly GorgonColor Gray50
Field Value
Type | Description |
---|---|
GorgonColor |
Gray60
60% gray.
Declaration
public static readonly GorgonColor Gray60
Field Value
Type | Description |
---|---|
GorgonColor |
Gray70
70% gray.
Declaration
public static readonly GorgonColor Gray70
Field Value
Type | Description |
---|---|
GorgonColor |
Gray75
75% gray.
Declaration
public static readonly GorgonColor Gray75
Field Value
Type | Description |
---|---|
GorgonColor |
Gray80
80% gray.
Declaration
public static readonly GorgonColor Gray80
Field Value
Type | Description |
---|---|
GorgonColor |
Gray90
90% gray.
Declaration
public static readonly GorgonColor Gray90
Field Value
Type | Description |
---|---|
GorgonColor |
Green
The Green color channel component.
Declaration
public readonly float Green
Field Value
Type | Description |
---|---|
float |
GreenPure
Pure green (Red = 0, Green = 1, Blue = 0).
Declaration
public static readonly GorgonColor GreenPure
Field Value
Type | Description |
---|---|
GorgonColor |
LightBlue
Light blue.
Declaration
public static readonly GorgonColor LightBlue
Field Value
Type | Description |
---|---|
GorgonColor |
LightCyan
Light cyan.
Declaration
public static readonly GorgonColor LightCyan
Field Value
Type | Description |
---|---|
GorgonColor |
LightGreen
Light green.
Declaration
public static readonly GorgonColor LightGreen
Field Value
Type | Description |
---|---|
GorgonColor |
LightPurple
Light purple.
Declaration
public static readonly GorgonColor LightPurple
Field Value
Type | Description |
---|---|
GorgonColor |
LightRed
Light red.
Declaration
public static readonly GorgonColor LightRed
Field Value
Type | Description |
---|---|
GorgonColor |
LightYellow
Light yellow.
Declaration
public static readonly GorgonColor LightYellow
Field Value
Type | Description |
---|---|
GorgonColor |
Orange
Orange.
Declaration
public static readonly GorgonColor Orange
Field Value
Type | Description |
---|---|
GorgonColor |
OrangeRed
OrangeRed.
Declaration
public static readonly GorgonColor OrangeRed
Field Value
Type | Description |
---|---|
GorgonColor |
PurplePure
Pure purple (Red = 1, Green = 0, Blue = 1).
Declaration
public static readonly GorgonColor PurplePure
Field Value
Type | Description |
---|---|
GorgonColor |
Red
The Red color channel component.
Declaration
public readonly float Red
Field Value
Type | Description |
---|---|
float |
RedPure
Pure red (Red = 1, Green = 0, Blue = 0).
Declaration
public static readonly GorgonColor RedPure
Field Value
Type | Description |
---|---|
GorgonColor |
SaddleBrown
Saddle brown.
Declaration
public static readonly GorgonColor SaddleBrown
Field Value
Type | Description |
---|---|
GorgonColor |
SeaGreen
SeaGreen.
Declaration
public static readonly GorgonColor SeaGreen
Field Value
Type | Description |
---|---|
GorgonColor |
SizeInBytes
The size of the value, in bytes.
Declaration
public static readonly int SizeInBytes
Field Value
Type | Description |
---|---|
int |
SteelBlue
Steel blue.
Declaration
public static readonly GorgonColor SteelBlue
Field Value
Type | Description |
---|---|
GorgonColor |
Transparent
A completely transparent color.
Declaration
public static readonly GorgonColor Transparent
Field Value
Type | Description |
---|---|
GorgonColor |
White
The color white.
Declaration
public static readonly GorgonColor White
Field Value
Type | Description |
---|---|
GorgonColor |
WhiteSmoke
WhiteSmoke.
Declaration
public static readonly GorgonColor WhiteSmoke
Field Value
Type | Description |
---|---|
GorgonColor |
YellowGreen
Yellow green.
Declaration
public static readonly GorgonColor YellowGreen
Field Value
Type | Description |
---|---|
GorgonColor |
YellowPure
Pure yellow (Red = 1, Green = 1, Blue = 0).
Declaration
public static readonly GorgonColor YellowPure
Field Value
Type | Description |
---|---|
GorgonColor |
Methods
| Edit this page View SourceAdd(GorgonColor, GorgonColor)
Function to add two GorgonColor values together.
Declaration
public static GorgonColor Add(GorgonColor left, GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left color to add. |
GorgonColor | right | The right color to add. |
Returns
Type | Description |
---|---|
GorgonColor | The total of the two colors. |
Remarks
This method does not clamp its output. Values greater than 1 or less than 0 are possible.
Add(in GorgonColor, in GorgonColor, out GorgonColor)
Function to add two GorgonColor values together.
Declaration
public static void Add(in GorgonColor left, in GorgonColor right, out GorgonColor outColor)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left color to add. |
GorgonColor | right | The right color to add. |
GorgonColor | outColor | The total of the two colors. |
Remarks
This method does not clamp its output. Values greater than 1 or less than 0 are possible.
ApplyGamma(float)
Function to apply a gamma value to this color to increase or decrease its intensity.
Declaration
public GorgonColor ApplyGamma(float gammaValue)
Parameters
Type | Name | Description |
---|---|---|
float | gammaValue | The gamma value to apply. |
Returns
Type | Description |
---|---|
GorgonColor | The adjusted color. |
Clamp(GorgonColor)
Function to clamp the color ranges from 0 to 1.
Declaration
public static GorgonColor Clamp(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to clamp. |
Returns
Type | Description |
---|---|
GorgonColor | The clamped color. |
Clamp(in GorgonColor, out GorgonColor)
Function to clamp the color ranges from 0 to 1.
Declaration
public static void Clamp(in GorgonColor color, out GorgonColor result)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to clamp. |
GorgonColor | result | The clamped color. |
Deconstruct(out float, out float, out float, out float)
Function to deconstruct the color into individual color components.
Declaration
public void Deconstruct(out float r, out float g, out float b, out float a)
Parameters
Type | Name | Description |
---|---|---|
float | r | The red component for the color. |
float | g | The green component for the color. |
float | b | The blue component for the color. |
float | a | The alpha component for the color. |
Equals(GorgonColor)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(GorgonColor other)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(in GorgonColor)
Indicates whether the current object is equal to another object of the same type by reference.
Declaration
public bool Equals(in GorgonColor other)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(in GorgonColor, in GorgonColor)
Function to compare two colors for equality.
Declaration
public static bool Equals(in GorgonColor left, in GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | Left color to compare. |
GorgonColor | right | Right color to compare. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool | true if the specified object is equal to this instance; otherwise, false. |
Overrides
| Edit this page View SourceFromABGR(int)
Function to convert a ABGR color into a GorgonColor.
Declaration
public static GorgonColor FromABGR(int abgrColor)
Parameters
Type | Name | Description |
---|---|---|
int | abgrColor | An int representing the color in ABGR format. |
Returns
Type | Description |
---|---|
GorgonColor | The GorgonColor representation. |
FromBGRA(int)
Function to convert a BGRA color into a GorgonColor.
Declaration
public static GorgonColor FromBGRA(int bgraColor)
Parameters
Type | Name | Description |
---|---|---|
int | bgraColor | An int representing the color in BGRA format. |
Returns
Type | Description |
---|---|
GorgonColor | The GorgonColor representation. |
FromRGBA(int)
Function to convert a RGBA color into a GorgonColor.
Declaration
public static GorgonColor FromRGBA(int rgbaColor)
Parameters
Type | Name | Description |
---|---|---|
int | rgbaColor | An int representing the color in RGBA format. |
Returns
Type | Description |
---|---|
GorgonColor | The GorgonColor representation. |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
| Edit this page View SourceGetIntegerComponents()
Function to deconstruct the color into individual color components.
Declaration
public (int R, int G, int B, int A) GetIntegerComponents()
Returns
Type | Description |
---|---|
(int R, int G, int B, int A) | A tuple containing the color channels as integer values scaled from 0 to 255. |
Lerp(GorgonColor, GorgonColor, float)
Function to perform linear interpolation between two GorgonColor values.
Declaration
public static GorgonColor Lerp(GorgonColor start, GorgonColor end, float weight)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | start | The starting GorgonColor. |
GorgonColor | end | The ending GorgonColor. |
float | weight | Value between 0 and 1.0f to indicate weighting between start and end. |
Returns
Type | Description |
---|---|
GorgonColor | The new GorgonColor representing a color between the |
Remarks
This will compute a new GorgonColor from the
Lerp(in GorgonColor, in GorgonColor, float, out GorgonColor)
Function to perform linear interpolation between two GorgonColor values.
Declaration
public static void Lerp(in GorgonColor start, in GorgonColor end, float weight, out GorgonColor outColor)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | start | The starting GorgonColor. |
GorgonColor | end | The ending GorgonColor. |
float | weight | Value between 0 and 1.0f to indicate weighting between start and end. |
GorgonColor | outColor | The new GorgonColor representing a color between the |
Remarks
This will compute a new GorgonColor from the
Multiply(GorgonColor, GorgonColor)
Function to multiply two GorgonColor values together.
Declaration
public static GorgonColor Multiply(GorgonColor left, GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left color to multiply. |
GorgonColor | right | The right color to multiply. |
Returns
Type | Description |
---|---|
GorgonColor | Product of the two colors. |
Multiply(GorgonColor, float)
Function to multiply a GorgonColor by a value.
Declaration
public static GorgonColor Multiply(GorgonColor color, float value)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to multiply. |
float | value | The value to multiply. |
Returns
Type | Description |
---|---|
GorgonColor | Product of the |
Multiply(in GorgonColor, in GorgonColor, out GorgonColor)
Function to multiply two GorgonColor values together.
Declaration
public static void Multiply(in GorgonColor left, in GorgonColor right, out GorgonColor outColor)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left color to multiply. |
GorgonColor | right | The right color to multiply. |
GorgonColor | outColor | Product of the two colors. |
Multiply(in GorgonColor, float, out GorgonColor)
Function to multiply a GorgonColor by a value.
Declaration
public static void Multiply(in GorgonColor color, float value, out GorgonColor outColor)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to multiply. |
float | value | The value to multiply. |
GorgonColor | outColor | Product of the |
SetAlpha(GorgonColor, float)
Function to apply an alpha value to the specified GorgonColor.
Declaration
public static GorgonColor SetAlpha(GorgonColor color, float alpha)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The GorgonColor to update. |
float | alpha | The alpha value to set. |
Returns
Type | Description |
---|---|
GorgonColor | A new GorgonColor instance with the same Red, Green, and Blue values but with a modified Alpha component. |
SetAlpha(in GorgonColor, float, out GorgonColor)
Function to apply an alpha value to the specified GorgonColor.
Declaration
public static void SetAlpha(in GorgonColor color, float alpha, out GorgonColor result)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The GorgonColor to update. |
float | alpha | The alpha value to set. |
GorgonColor | result | The resulting updated GorgonColor. |
Subtract(GorgonColor, GorgonColor)
Function to subtract two GorgonColor values from each other.
Declaration
public static GorgonColor Subtract(GorgonColor left, GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left color to subtract. |
GorgonColor | right | The right color to subtract. |
Returns
Type | Description |
---|---|
GorgonColor | The difference between the two colors. |
Remarks
This method does not clamp its output. Values greater than 1 or less than 0 are possible.
Subtract(in GorgonColor, in GorgonColor, out GorgonColor)
Function to subtract two GorgonColor values from each other.
Declaration
public static void Subtract(in GorgonColor left, in GorgonColor right, out GorgonColor outColor)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left color to subtract. |
GorgonColor | right | The right color to subtract. |
GorgonColor | outColor | The difference between the two colors. |
Remarks
This method does not clamp its output. Values greater than 1 or less than 0 are possible.
ToABGR()
Function to convert this GorgonColor value into an int value with a ABGR format.
Declaration
[Pure]
public int ToABGR()
Returns
Type | Description |
---|---|
int | An int representing the color value in ARGB format. |
Remarks
The format indicates the byte position of each color component in the int value.
ToARGB()
Function to convert this GorgonColor value into an int value with a ARGB format.
Declaration
[Pure]
public int ToARGB()
Returns
Type | Description |
---|---|
int | An int representing the color value in ARGB format. |
Remarks
The format indicates the byte position of each color component in the int value.
ToBGRA()
Function to convert this GorgonColor value into an int value with a BGRA format.
Declaration
[Pure]
public int ToBGRA()
Returns
Type | Description |
---|---|
int | An int representing the color value in ARGB format. |
Remarks
The format indicates the byte position of each color component in the int value.
ToColor()
Function to convert this GorgonColor into a Color.
Declaration
[Pure]
public Color ToColor()
Returns
Type | Description |
---|---|
Color | The Color value. |
ToColor(GorgonColor)
Function to perform an implicit conversion from GorgonColor to Color.
Declaration
public static Color ToColor(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to convert. |
Returns
Type | Description |
---|---|
Color | The result of the conversion. |
ToGorgonColor(Color)
Function to perform an implicit conversion from a SharpDX.Color
to GorgonColor.
Declaration
public static GorgonColor ToGorgonColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to convert. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
ToGorgonColor(Color)
Function to perform an implicit conversion from Color to GorgonColor.
Declaration
public static GorgonColor ToGorgonColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to convert. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
ToGorgonColor(int)
Function to perform an implicit conversion from int to GorgonColor.
Declaration
public static GorgonColor ToGorgonColor(int color)
Parameters
Type | Name | Description |
---|---|---|
int | color | The color. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
Remarks
This operator assumes the
ToGorgonColor(Vector3)
Function to perform an explicit conversion from Vector3 to GorgonColor.
Declaration
public static GorgonColor ToGorgonColor(Vector3 color)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | color | The color. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
Remarks
This will map the Vector3.X, Vector3.Y and Vector3.Z components to the Red, Green and Blue values respectively. The Alpha value is set to 1.0f (opaque) for this conversion.
ToGorgonColor(Vector4)
Function to perform an implicit conversion from Vector4 to GorgonColor.
Declaration
public static GorgonColor ToGorgonColor(Vector4 color)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | color | The color. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
Remarks
This will map the Vector4.X, Vector4.Y, Vector4.Z and Vector4.W components to the Red, Green, Blue and Alpha values respectively.
ToHex()
Function to convert this GorgonColor value into a hexadecimal formatting string.
Declaration
[Pure]
public string ToHex()
Returns
Type | Description |
---|---|
string | The color represented as a hexadecimal string. |
Remarks
The format of the string will be as follows: AARRGGBB.
ToInt32(GorgonColor)
Function to perform an implicit conversion from GorgonColor to int.
Declaration
public static int ToInt32(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to convert. |
Returns
Type | Description |
---|---|
int | The result of the conversion. |
Remarks
This will return the color in ARGB format.
ToLinear()
Function to convert the sRGB version of the color to a linear color value.
Declaration
[Pure]
public GorgonColor ToLinear()
Returns
Type | Description |
---|---|
GorgonColor | The linear color value. |
ToRGBA()
Function to convert this GorgonColor value into an int value with a RGBA format.
Declaration
[Pure]
public int ToRGBA()
Returns
Type | Description |
---|---|
int | An int representing the color value in ARGB format. |
Remarks
The format indicates the byte position of each color component in the int value.
ToSRgb()
Function to convert the linear version of the color to a sRGB color value.
Declaration
[Pure]
public GorgonColor ToSRgb()
Returns
Type | Description |
---|---|
GorgonColor | The linear color value. |
ToSharpDXColor()
Function to conver this GorgonColor into a SharpDX.Color
.
Declaration
[Pure]
public Color ToSharpDXColor()
Returns
Type | Description |
---|---|
Color | The |
ToSharpDXColor(GorgonColor)
Function to perform an implicit conversion from GorgonColor to a SharpDX.Color
.
Declaration
public static Color ToSharpDXColor(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to convert. |
Returns
Type | Description |
---|---|
Color | The SharpDX color. |
ToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
| Edit this page View SourceToVector3()
Function to convert this GorgonColor into a Vector3.
Declaration
[Pure]
public Vector3 ToVector3()
Returns
Type | Description |
---|---|
Vector3 | The Vector3 value. |
Remarks
This will map the Red, Green and Blue components to the Vector3.X, Vector3.Y and Vector3.Z values respectively.
ToVector3(GorgonColor)
Function to perform an explicit conversion from GorgonColor to Vector3.
Declaration
public static Vector3 ToVector3(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color. |
Returns
Type | Description |
---|---|
Vector3 | The result of the conversion. |
Remarks
This will map the Red, Green and Blue components to the Vector3.X, Vector3.Y and Vector3.Z values respectively.
ToVector4()
Function to convert this GorgonColor into a Vector4.
Declaration
[Pure]
public Vector4 ToVector4()
Returns
Type | Description |
---|---|
Vector4 | The Vector4 value. |
Remarks
This will map the Red, Green, Blue and Alpha components to the Vector4.X, Vector4.Y, Vector4.Z and Vector4.W values respectively.
ToVector4(GorgonColor)
Function to perform an implicit conversion from GorgonColor to Vector4.
Declaration
public static Vector4 ToVector4(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color. |
Returns
Type | Description |
---|---|
Vector4 | The result of the conversion. |
Remarks
This will map the Red, Green, Blue and Alpha components to the Vector4.X, Vector4.Y, Vector4.Z and Vector4.W values respectively.
Operators
| Edit this page View Sourceoperator +(GorgonColor, GorgonColor)
An operator to add two GorgonColor values together.
Declaration
public static GorgonColor operator +(GorgonColor left, GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left value. |
GorgonColor | right | The right value. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the operator. |
Remarks
This method does not clamp its output. Values greater than 1 or less than 0 are possible.
operator ==(GorgonColor, GorgonColor)
An operator to determine if two instances are equal.
Declaration
public static bool operator ==(GorgonColor left, GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left value. |
GorgonColor | right | The right value. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
explicit operator Vector3(GorgonColor)
Performs an explicit conversion from GorgonColor to Vector3.
Declaration
public static explicit operator Vector3(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color. |
Returns
Type | Description |
---|---|
Vector3 | The result of the conversion. |
Remarks
This will map the Red, Green and Blue components to the Vector3.X, Vector3.Y and Vector3.Z values respectively.
explicit operator GorgonColor(Vector3)
Performs an explicit conversion from Vector3 to GorgonColor.
Declaration
public static explicit operator GorgonColor(Vector3 color)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | color | The color. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
Remarks
This will map the Vector3.X, Vector3.Y and Vector3.Z components to the Red, Green and Blue values respectively. The Alpha value is set to 1.0f (opaque) for this conversion.
implicit operator Color(GorgonColor)
Performs an implicit conversion from GorgonColor to a SharpDX.Color
.
Declaration
public static implicit operator Color(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to convert. |
Returns
Type | Description |
---|---|
Color | The result of the conversion. |
implicit operator Color(GorgonColor)
Performs an implicit conversion from GorgonColor to Color.
Declaration
public static implicit operator Color(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to convert. |
Returns
Type | Description |
---|---|
Color | The result of the conversion. |
implicit operator int(GorgonColor)
Performs an implicit conversion from GorgonColor to int.
Declaration
public static implicit operator int(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to convert. |
Returns
Type | Description |
---|---|
int | The result of the conversion. |
Remarks
This will return the color in ARGB format.
implicit operator Vector4(GorgonColor)
Performs an implicit conversion from GorgonColor to Vector4.
Declaration
public static implicit operator Vector4(GorgonColor color)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color. |
Returns
Type | Description |
---|---|
Vector4 | The result of the conversion. |
Remarks
This will map the Red, Green, Blue and Alpha components to the Vector4.X, Vector4.Y, Vector4.Z and Vector4.W values respectively.
implicit operator GorgonColor(Color)
Performs an implicit conversion from a SharpDX.Color
to a GorgonColor.
Declaration
public static implicit operator GorgonColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to convert. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
implicit operator GorgonColor(Color)
Performs an implicit conversion from Color to GorgonColor.
Declaration
public static implicit operator GorgonColor(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to convert. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
implicit operator GorgonColor(int)
Performs an implicit conversion from int to GorgonColor.
Declaration
public static implicit operator GorgonColor(int color)
Parameters
Type | Name | Description |
---|---|---|
int | color | The color. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
Remarks
This operator assumes the
implicit operator GorgonColor(Vector4)
Performs an implicit conversion from Vector4 to GorgonColor.
Declaration
public static implicit operator GorgonColor(Vector4 color)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | color | The color. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the conversion. |
Remarks
This will map the Vector4.X, Vector4.Y, Vector4.Z and Vector4.W components to the Red, Green, Blue and Alpha values respectively.
operator !=(GorgonColor, GorgonColor)
An operator to determine if two instances are not equal.
Declaration
public static bool operator !=(GorgonColor left, GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left value. |
GorgonColor | right | The right value. |
Returns
Type | Description |
---|---|
bool | true if not equal, false if equal. |
operator *(GorgonColor, GorgonColor)
An operator to multiply two GorgonColor values together.
Declaration
public static GorgonColor operator *(GorgonColor left, GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left value. |
GorgonColor | right | The right value. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the operator. |
operator *(GorgonColor, float)
An operator to multiply a GorgonColor and a float value.
Declaration
public static GorgonColor operator *(GorgonColor color, float value)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | color | The color to multiply. |
float | value | The value to multiply by. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the operator. |
operator -(GorgonColor, GorgonColor)
An operator to subtract two GorgonColor values from each other.
Declaration
public static GorgonColor operator -(GorgonColor left, GorgonColor right)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | left | The left value. |
GorgonColor | right | The right value. |
Returns
Type | Description |
---|---|
GorgonColor | The result of the operator. |
Remarks
This method does not clamp its output. Values greater than 1 or less than 0 are possible.