Description
The RgbaInt
property of the Color
struct provides an integer representation of the color in the format 0xRRGGBBAA
. This format encodes the red, green, blue, and alpha components of the color into a single 32-bit unsigned integer, where each component is represented by 8 bits.
Usage
Use the RgbaInt
property when you need a compact integer representation of a color, for example, when interfacing with systems or APIs that require color data in this format. Note that this property is marked with the JsonIgnore
attribute, meaning it will not be serialized or deserialized by JSON serializers that respect this attribute.
Example
// Example of accessing the RgbaInt property
Color color = new Color(1.0f, 0.5f, 0.25f, 0.75f);
uint rgbaInt = color.RgbaInt;
// rgbaInt now holds the integer representation of the color in 0xRRGGBBAA format