From 55af41f5cbf5d72d94a2ed542e99ab0e76b9ec4d Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 17 Mar 2022 14:27:24 -0400 Subject: [PATCH] implement Color.ToUInt32 --- MBS.Framework/Drawing/Color.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MBS.Framework/Drawing/Color.cs b/MBS.Framework/Drawing/Color.cs index ad17a2d..0d57db2 100644 --- a/MBS.Framework/Drawing/Color.cs +++ b/MBS.Framework/Drawing/Color.cs @@ -203,7 +203,13 @@ namespace MBS.Framework.Drawing public int ToInt32() { - return BitConverter.ToInt32(new byte[] { (byte)mvarA, (byte)mvarB, (byte)mvarG, (byte)mvarR }, 0); + int index = BitConverter.ToInt32(new byte[] { GetAlphaByte(), GetBlueByte(), GetGreenByte(), GetRedByte() }, 0); + return index; + } + public uint ToUInt32() + { + uint index = BitConverter.ToUInt32(new byte[] { GetAlphaByte(), GetBlueByte(), GetGreenByte(), GetRedByte() }, 0); + return index; } public override string ToString()