Struct Color32
Representation of RGBA colors in 32 bit format (8 bits per component in RGBA order).
Assembly: FlaxEngine.dll
File: Engine/Core/Math/Color32.h
Syntax
public struct Color32
Constructors
Color32()
Empty constructor.
Declaration
public Color32() = default
Color32(byte r, byte g, byte b, byte a)
Constructs a new Color32 with given r, g, b, a components.
Declaration
public Color32(byte r, byte g, byte b, byte a)
Parameters
byte
r
The red component value. |
byte
g
The green component value. |
byte
b
The value component value. |
byte
a
The alpha component value. |
Color32(const Color& c)
Color32(const Vector4& c)
Declaration
public Color32(const Vector4& c)
Parameters
Vector4
c
|
Fields
A
Alpha component of the color.
Declaration
public byte A
Field Value
byte
|
B
Blue component of the color.
Declaration
public byte B
Field Value
byte
|
Black
G
Green component of the color.
Declaration
public byte G
Field Value
byte
|
R
Red component of the color.
Declaration
public byte R
Field Value
byte
|
Raw
Color packed into 32 bits
Declaration
public uint32 Raw
Field Value
uint32
|
Transparent
White
Methods
FromRGB(uint32 rgb, byte a=255)
Initializes from packed RGB value of the color and separate alpha channel value.
Declaration
public static Color32 FromRGB(uint32 rgb, byte a=255)
Parameters
uint32
rgb
The packed RGB value. |
byte
a
The alpha channel. |
Returns
Color32
The color. |
FromRGBA(float r, float g, float b, float a)
Declaration
public static Color32 FromRGBA(float r, float g, float b, float a)
Parameters
float
r
|
float
g
|
float
b
|
float
a
|
Returns
Color32
|
GetAsABGR()
Declaration
public uint32 GetAsABGR() const
Returns
uint32
|
GetAsARGB()
Declaration
public uint32 GetAsARGB() const
Returns
uint32
|
GetAsBGRA()
Declaration
public uint32 GetAsBGRA() const
Returns
uint32
|
GetAsRGB()
Declaration
public uint32 GetAsRGB() const
Returns
uint32
|
GetAsRGBA()
Declaration
public uint32 GetAsRGBA() const
Returns
uint32
|
GetHashCode()
Declaration
public uint32 GetHashCode() const
Returns
uint32
|
GetHashCode(const Color32& v)
HasOpacity()
Declaration
public bool HasOpacity() const
Returns
bool
|
IsTransparent()
Declaration
public bool IsTransparent() const
Returns
bool
|
Lerp(const Color32& a, const Color32& b, const float t)
Linearly interpolates between colors a and b by normalized weight t.
Declaration
public static Color32 Lerp(const Color32& a, const Color32& b, const float t)
Parameters
Color32
a
The start value. |
Color32
b
The end value. |
float
t
The linear blend weight. |
Returns
Color32
|
operator!=(const Color32& other)
Declaration
public bool operator!=(const Color32& other) const
Parameters
Color32
other
|
Returns
bool
|
operator-(const Color32& b)
operator*(const Color32& b)
operator*(float b)
operator*=(const Color32& b)
operator+(const Color32& b)
operator+=(const Color32& b)
operator-=(const Color32& b)
operator==(const Color32& other)
Declaration
public bool operator==(const Color32& other) const
Parameters
Color32
other
|
Returns
bool
|