Struct Color
RGBA floating-point color.
Syntax
public struct Color : IEquatable<Color>
Constructors
Color(Single, Single, Single, Single)
Declaration
public Color(float red, float green, float blue, float alpha = 1F)
Parameters
Fields
Value
Declaration
Field Value
Properties
a
Alpha value, range is [0..1]
Declaration
public float a { get; set; }
Property Value
b
Blue value, range is [0..1]
Declaration
public float b { get; set; }
Property Value
Default
Declaration
public static Color Default { get; }
Property Value
g
Green value, range is [0..1]
Declaration
public float g { get; set; }
Property Value
r
Red value, range is [0..1]
Declaration
public float r { get; set; }
Property Value
Methods
AsFloat4()
Declaration
Returns
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| Object |
obj |
|
Returns
Overrides
Equals(Color)
Declaration
public bool Equals(Color c)
Parameters
| Type |
Name |
Description |
| Color |
c |
|
Returns
FromFloat4(float4)
Declaration
public void FromFloat4(float4 c)
Parameters
| Type |
Name |
Description |
| float4 |
c |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
Lerp(Color, Color, Single)
Declaration
public static Color Lerp(Color c1, Color c2, float time)
Parameters
Returns
LinearToSRGB(float3)
Declaration
public static float3 LinearToSRGB(float3 rgb)
Parameters
| Type |
Name |
Description |
| float3 |
rgb |
|
Returns
LinearToSRGB(float4)
Declaration
public static float4 LinearToSRGB(float4 rgba)
Parameters
| Type |
Name |
Description |
| float4 |
rgba |
|
Returns
LinearToSRGB(Single)
Declaration
public static float LinearToSRGB(float x)
Parameters
| Type |
Name |
Description |
| Single |
x |
|
Returns
SRGBToLinear(float3)
Declaration
public static float3 SRGBToLinear(float3 rgb)
Parameters
| Type |
Name |
Description |
| float3 |
rgb |
|
Returns
SRGBToLinear(float4)
Declaration
public static float4 SRGBToLinear(float4 rgba)
Parameters
| Type |
Name |
Description |
| float4 |
rgba |
|
Returns
SRGBToLinear(Single)
Declaration
public static float SRGBToLinear(float x)
Parameters
| Type |
Name |
Description |
| Single |
x |
|
Returns
ToLinear()
Declaration
Returns
Operators
Addition(Color, Color)
Declaration
public static Color operator +(Color cl, Color cr)
Parameters
Returns
Equality(Color, Color)
Declaration
public static bool operator ==(Color cl, Color cr)
Parameters
Returns
Inequality(Color, Color)
Declaration
public static bool operator !=(Color cl, Color cr)
Parameters
Returns
Multiply(Color, Single)
Declaration
public static Color operator *(Color cl, float v)
Parameters
Returns
Multiply(Color, Color)
Declaration
public static Color operator *(Color cl, Color cr)
Parameters
Returns