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 rgba(r, g, b, a)
format, where r
, g
, b
, and a
are the red, green, blue, and alpha components of the color, respectively. Each component is expressed as an integer value between 0 and 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)"