Struct GammaColor
Represents a 32-bit color in gamma space.
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public struct GammaColor
Constructors
GammaColor(ref Color)
Initializes a new instance of the GammaColor struct.
Declaration
public GammaColor(ref Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The Color instance in sRGB space. |
GammaColor(Vector3)
Initializes a new instance of the GammaColor struct.
Declaration
public GammaColor(Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | A Vector3 containing the color data. |
GammaColor(Vector4)
Initializes a new instance of the GammaColor struct.
Declaration
public GammaColor(Vector4 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | vector | Vector4 containing the color data. |
GammaColor(float, float, float, float)
Initializes a new instance of the GammaColor struct.
Declaration
public GammaColor(float r, float g, float b, float a = 1)
Parameters
Type | Name | Description |
---|---|---|
float | r | The red color component in linear space. |
float | g | The green color component in linear space. |
float | b | The blue color component in linear space. |
float | a | The alpha color component in linear space. |
Fields
A
The w-coordinate of this GammaColor.
Declaration
public float A
Field Value
Type | Description |
---|---|
float |
AsVector3
The linear color is converted to Vector3.
Declaration
public Vector3 AsVector3
Field Value
Type | Description |
---|---|
Vector3 |
AsVector4
The linear color is converted to Vector4.
Declaration
public Vector4 AsVector4
Field Value
Type | Description |
---|---|
Vector4 |
B
The Z coordinate of this GammaColor.
Declaration
public float B
Field Value
Type | Description |
---|---|
float |
G
The y-coordinate of this GammaColor.
Declaration
public float G
Field Value
Type | Description |
---|---|
float |
R
The x-coordinate of this GammaColor.
Declaration
public float R
Field Value
Type | Description |
---|---|
float |
Methods
Equals(GammaColor)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(GammaColor other)
Parameters
Type | Name | Description |
---|---|---|
GammaColor | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(ref GammaColor)
Indicates whether this instance and a specified GammaColor are equal.
Declaration
public bool Equals(ref GammaColor other)
Parameters
Type | Name | Description |
---|---|---|
GammaColor | other | The color to compare with the current instance. |
Returns
Type | Description |
---|---|
bool |
|
Equals(object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
ToLinear(out LinearColor)
Converts to linear color space.
Declaration
public void ToLinear(out LinearColor linearColor)
Parameters
Type | Name | Description |
---|---|---|
LinearColor | linearColor | The converted linear color. |
ToSRGB(out GammaColor)
Converts to sRGB color space.
Declaration
public void ToSRGB(out GammaColor sRGBColor)
Parameters
Type | Name | Description |
---|---|---|
GammaColor | sRGBColor | The converted sRGB color. |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |