The Rgba
property of the Color32
struct provides a string representation of the color in the CSS rgba
function notation. This format is commonly used in web development to specify colors with an alpha channel, allowing for transparency.
The Rgba
property of the Color32
struct provides a string representation of the color in the CSS rgba
function notation. This format is commonly used in web development to specify colors with an alpha channel, allowing for transparency.
Use the Rgba
property to obtain a string that represents the color in the format rgba(r, g, b, a)
, where r
, g
, b
, and a
are the red, green, blue, and alpha components of the color, respectively. Each component is an integer value ranging from 0 to 255.
// Example of using the Rgba property Color32 color = new Color32 { r = 255, g = 100, b = 50, a = 128 }; string rgbaString = color.Rgba; // rgbaString will be "rgba(255, 100, 50, 0.5)"