Colors are stored as RGBA byte values and this gives back the usual RGBA format as an
optimized 32 bit value. R takes the first 8 bits, G the next 8 up to A for the last 8 bits.
View code on GitHub
Namespace: DeltaEngine.DatatypesAssembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: Int32Remarks
Examples
[Test] public void PackedRgba() { var color1 = new Color(10, 20, 30, 40); var color2 = new Color(20, 30, 40, 50); var color3 = new Color(200, 200, 200, 200); Assert.AreNotEqual(color1.PackedRgba, color2.PackedRgba); Assert.AreEqual(color1.PackedRgba, color1.R + ((uint)color1.G << 8) + ((uint)color1.B << 16) + ((uint)color1.A << 24)); Assert.AreEqual((uint)color3.PackedRgba, color3.R + ((uint)color3.G << 8) + ((uint)color3.B << 16) + ((uint)color3.A << 24)); }
See Also