Struct ColorF
- Namespace
- MohawkGame2D
- Assembly
- GAME 10003 Game Development Foundations - 2D Game Template.dll
Represents an RGBA color (128-bit) using 32-bit float color components (numbers from 0.0f to 1.0f).
public struct ColorF
- Inherited Members
Constructors
ColorF()
Create a new color. Black.
public ColorF()
ColorF(float)
Create a new grayscale color using the intensity
value.
public ColorF(float intensity)
Parameters
intensity
floatThe intensity (brightness) value (0.0f-1.0f).
ColorF(float, float)
Create a new grayscale color using the intensity
value
with opacity
.
public ColorF(float intensity, float opacity)
Parameters
intensity
floatThe intensity (brightness) value (0.0f-1.0f).
opacity
floatThe opacity value, 0f for fully translucid, 1f for fully opaque.
ColorF(float, float, float)
Creates a new RGB color.
public ColorF(float r, float g, float b)
Parameters
r
floatRed color channel value (0.0f-1.0f).
g
floatGreen color channel value (0.0f-1.0f).
b
floatBlue color channel value (0.0f-1.0f).
ColorF(float, float, float, float)
Creates a new RGBA color.
public ColorF(float r, float g, float b, float a)
Parameters
r
floatRed color channel value (0.0f-1.0f).
g
floatGreen color channel value (0.0f-1.0f).
b
floatBlue color channel value (0.0f-1.0f).
a
floatAlpha channel value (0.0f-1.0f).
Properties
A
Alpha colour channel (0.0f-1.0f).
public float A { readonly get; set; }
Property Value
B
Blue colour channel (0.0f-1.0f).
public float B { readonly get; set; }
Property Value
G
Green colour channel (0.0f-1.0f).
public float G { readonly get; set; }
Property Value
R
Red colour channel (0.0f-1.0f).
public float R { readonly get; set; }
Property Value
Methods
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
The fully qualified type name.