The RgbInt
property of the Color32
struct provides an integer representation of the color in the format 0xRRGGBB
. This format is useful for operations that require a compact representation of the color without the alpha component.
The RgbInt
property of the Color32
struct provides an integer representation of the color in the format 0xRRGGBB
. This format is useful for operations that require a compact representation of the color without the alpha component.
Use the RgbInt
property when you need to work with the RGB components of a color as a single integer value. This can be particularly useful for serialization, storage, or when interfacing with systems that require color data in this format.
// Example of using the RgbInt property Color32 color = new Color32 { r = 255, g = 165, b = 0, a = 255 }; // Orange color uint rgbValue = color.RgbInt; // rgbValue will be 0xFFA500, representing the RGB components of the color // You can also create a Color32 from an RGB integer Color32 newColor = Color32.FromRgb(rgbValue); // newColor will have the same RGB components as the original color