Struct Rgba32
- Namespace
- Icy.Rendering
- Assembly
- IcyUI.dll
Represents a color of the texture that contains Red, Green, Blue and Alpha channels.
public struct Rgba32
- Inherited Members
- Extension Methods
Remarks
This type of colors is the most commonly used when handling textures over the game engines.
Constructors
Rgba32(byte, byte, byte, byte)
Initializes a new instance of the Rgba32 struct.
public Rgba32(byte r, byte g, byte b, byte a)
Parameters
rbyteValue of the red color channel.
gbyteValue of the blue color channel.
bbyteValue of the green color channel.
abyteValue of the alpha color channel.
Fields
A
Gets or sets the value of the Alpha color channel.
public byte A
Field Value
B
Gets or sets the value of the Blue color channel.
public byte B
Field Value
G
Gets or sets the value of the Green color channel.
public byte G
Field Value
R
Gets or sets the value of the Red color channel.
public byte R
Field Value
Methods
FromColor(Color)
public static Rgba32 FromColor(Color c)
Parameters
Returns
GetIntensity()
Gets the brightness of the current pixel, needed for some calculations.
public readonly byte GetIntensity()
Returns
Remarks
This metric is calculated using the following formula: (R + G + B) / 3.
Common usages of it can be alpha pre-multiplication.
GetPackedValue()
public readonly int GetPackedValue()
Returns
ToColor()
public readonly Color ToColor()
Returns
Operators
explicit operator Color(Rgba32)
public static explicit operator Color(Rgba32 p)
Parameters
Returns
explicit operator Rgba32(Color)
public static explicit operator Rgba32(Color c)