static Color32 FromRgba( System.UInt32 rgba )

book_4_sparkGenerated
code_blocksInput

Description

The Color32.FromRgba method is a static method that creates a Color32 instance from a 32-bit unsigned integer representing a color in RGBA format. The integer is expected to be in the format 0xRRGGBBAA, where RR, GG, BB, and AA are the red, green, blue, and alpha components of the color, respectively.

Usage

To use the FromRgba method, pass a 32-bit unsigned integer that encodes the color in RGBA format. The method will return a Color32 object representing the color.

Example

// Example of using Color32.FromRgba
uint rgbaValue = 0xFF00FF00; // Green color with full opacity
Color32 color = Color32.FromRgba(rgbaValue);

// Accessing the color components
byte red = color.r;   // 0
byte green = color.g; // 255
byte blue = color.b;  // 0
byte alpha = color.a; // 255