Struct LinearColor
Represents a 32-bit color in linear space.
Namespace: Evergine.Common.Graphics
Assembly: Evergine.Common.dll
Syntax
public struct LinearColor
Constructors
LinearColor(ref Color)
Initializes a new instance of the LinearColor struct.
Declaration
public LinearColor(ref Color gammaColor)
Parameters
Type | Name | Description |
---|---|---|
Color | gammaColor | The Color instance in Gamma space. |
LinearColor(Vector3)
Initializes a new instance of the LinearColor struct.
Declaration
public LinearColor(Vector3 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | vector | Vector3 with the color data. |
LinearColor(Vector4)
Initializes a new instance of the LinearColor struct.
Declaration
public LinearColor(Vector4 vector)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | vector | A Vector4 containing the color data. |
LinearColor(float)
Initializes a new instance of the LinearColor struct.
Declaration
public LinearColor(float k)
Parameters
Type | Name | Description |
---|---|---|
float | k | The color temperature in Kelvins. |
LinearColor(float, float, float, float)
Initializes a new instance of the LinearColor struct.
Declaration
public LinearColor(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. |
LinearColor(string)
Initializes a new instance of the LinearColor struct.
Declaration
public LinearColor(string hex)
Parameters
Type | Name | Description |
---|---|---|
string | hex | Hexadecimal color code. |
Fields
A
The w-coordinate of this LinearColor.
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 LinearColor.
Declaration
public float B
Field Value
Type | Description |
---|---|
float |
G
The y-coordinate of this LinearColor.
Declaration
public float G
Field Value
Type | Description |
---|---|
float |
R
The x-coordinate of this LinearColor.
Declaration
public float R
Field Value
Type | Description |
---|---|
float |
Methods
Equals(LinearColor)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(LinearColor other)
Parameters
Type | Name | Description |
---|---|---|
LinearColor | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(ref LinearColor)
Indicates whether this instance and a specified LinearColor are equal.
Declaration
public bool Equals(ref LinearColor other)
Parameters
Type | Name | Description |
---|---|---|
LinearColor | other | The LinearColor 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
ToColor()
Converts to Color (in Gamma space).
Declaration
public Color ToColor()
Returns
Type | Description |
---|---|
Color | The output color. |
ToColor(out Color)
Converts to Color (in Gamma space).
Declaration
public void ToColor(out Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The output color. |
ToGamma()
Converts to Gamma color space.
Declaration
public GammaColor ToGamma()
Returns
Type | Description |
---|---|
GammaColor | The converted GammaColor. |
ToGamma(out GammaColor)
Converts to Gamma color space.
Declaration
public void ToGamma(out GammaColor gammaColor)
Parameters
Type | Name | Description |
---|---|---|
GammaColor | gammaColor | The converted Gamma color. |
ToLinear()
Converts to linear color space.
Declaration
public LinearColor ToLinear()
Returns
Type | Description |
---|---|
LinearColor | The converted linear color. |
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. |
ToString()
Returns the fully qualified type name of this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The fully qualified type name. |
Overrides
Operators
operator /(LinearColor, float)
Implements the operator /.
Declaration
public static LinearColor operator /(LinearColor a, float b)
Parameters
Type | Name | Description |
---|---|---|
LinearColor | a | The first LinearColor. |
float | b | The second LinearColor. |
Returns
Type | Description |
---|---|
LinearColor | The result of the operator. |
operator ==(LinearColor, LinearColor)
Implements the operator ==.
Declaration
public static bool operator ==(LinearColor lhs, LinearColor rhs)
Parameters
Type | Name | Description |
---|---|---|
LinearColor | lhs | The left-hand side. |
LinearColor | rhs | The right-hand side. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator !=(LinearColor, LinearColor)
Implements the operator !=.
Declaration
public static bool operator !=(LinearColor lhs, LinearColor rhs)
Parameters
Type | Name | Description |
---|---|---|
LinearColor | lhs | The left-hand side operand. |
LinearColor | rhs | The right-hand side operand. |
Returns
Type | Description |
---|---|
bool | The result of the operator. |
operator *(LinearColor, float)
Implements the * operator.
Declaration
public static LinearColor operator *(LinearColor a, float b)
Parameters
Type | Name | Description |
---|---|---|
LinearColor | a | The first LinearColor. |
float | b | The second LinearColor. |
Returns
Type | Description |
---|---|
LinearColor | The result of the operation. |
operator *(float, LinearColor)
Implements the * operator.
Declaration
public static LinearColor operator *(float b, LinearColor a)
Parameters
Type | Name | Description |
---|---|---|
float | b | The first LinearColor. |
LinearColor | a | The second LinearColor. |
Returns
Type | Description |
---|---|
LinearColor | The result of the operator. |