From 0cdc398e4372b0135522bc687f8fcfd20aaa1dd2 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 20 Jan 2021 16:09:29 -0800 Subject: [PATCH] rearrange Color struct --- src/Graphics/Color.cs | 72 +++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/src/Graphics/Color.cs b/src/Graphics/Color.cs index eeab6a61..904b567a 100644 --- a/src/Graphics/Color.cs +++ b/src/Graphics/Color.cs @@ -32,6 +32,42 @@ namespace MoonWorks.Graphics { #region Public Properties + /// + /// Gets or sets the red component. + /// + public byte R + { + get + { + unchecked + { + return (byte)(this.packedValue); + } + } + set + { + this.packedValue = (this.packedValue & 0xffffff00) | value; + } + } + + /// + /// Gets or sets the green component. + /// + public byte G + { + get + { + unchecked + { + return (byte)(this.packedValue >> 8); + } + } + set + { + this.packedValue = (this.packedValue & 0xffff00ff) | ((uint)value << 8); + } + } + /// /// Gets or sets the blue component. /// @@ -50,42 +86,6 @@ namespace MoonWorks.Graphics } } - /// - /// Gets or sets the green component. - /// - public byte G - { - get - { - unchecked - { - return (byte) (this.packedValue >> 8); - } - } - set - { - this.packedValue = (this.packedValue & 0xffff00ff) | ((uint) value << 8); - } - } - - /// - /// Gets or sets the red component. - /// - public byte R - { - get - { - unchecked - { - return (byte) (this.packedValue); - } - } - set - { - this.packedValue = (this.packedValue & 0xffffff00) | value; - } - } - /// /// Gets or sets the alpha component. ///