rearrange Color struct

pull/14/head
cosmonaut 2021-01-20 16:09:29 -08:00
parent a025e9ad76
commit 0cdc398e43
1 changed files with 36 additions and 36 deletions

View File

@ -32,6 +32,42 @@ namespace MoonWorks.Graphics
{ {
#region Public Properties #region Public Properties
/// <summary>
/// Gets or sets the red component.
/// </summary>
public byte R
{
get
{
unchecked
{
return (byte)(this.packedValue);
}
}
set
{
this.packedValue = (this.packedValue & 0xffffff00) | value;
}
}
/// <summary>
/// Gets or sets the green component.
/// </summary>
public byte G
{
get
{
unchecked
{
return (byte)(this.packedValue >> 8);
}
}
set
{
this.packedValue = (this.packedValue & 0xffff00ff) | ((uint)value << 8);
}
}
/// <summary> /// <summary>
/// Gets or sets the blue component. /// Gets or sets the blue component.
/// </summary> /// </summary>
@ -50,42 +86,6 @@ namespace MoonWorks.Graphics
} }
} }
/// <summary>
/// Gets or sets the green component.
/// </summary>
public byte G
{
get
{
unchecked
{
return (byte) (this.packedValue >> 8);
}
}
set
{
this.packedValue = (this.packedValue & 0xffff00ff) | ((uint) value << 8);
}
}
/// <summary>
/// Gets or sets the red component.
/// </summary>
public byte R
{
get
{
unchecked
{
return (byte) (this.packedValue);
}
}
set
{
this.packedValue = (this.packedValue & 0xffffff00) | value;
}
}
/// <summary> /// <summary>
/// Gets or sets the alpha component. /// Gets or sets the alpha component.
/// </summary> /// </summary>