1- namespace HexaEngine . Mathematics
1+ namespace Hexa . NET . Mathematics
22{
33 using System ;
44 using System . Numerics ;
@@ -77,9 +77,9 @@ public Color(byte r, byte g, byte b, byte a)
7777 /// <param name="color">The unsigned integer representation of the color.</param>
7878 public Color ( uint color )
7979 {
80- R = ( float ) ( ( color >> 24 ) & 0xff ) / byte . MaxValue ;
81- G = ( float ) ( ( color >> 16 ) & 0xff ) / byte . MaxValue ;
82- B = ( float ) ( ( color >> 8 ) & 0xff ) / byte . MaxValue ;
80+ R = ( float ) ( color >> 24 & 0xff ) / byte . MaxValue ;
81+ G = ( float ) ( color >> 16 & 0xff ) / byte . MaxValue ;
82+ B = ( float ) ( color >> 8 & 0xff ) / byte . MaxValue ;
8383 A = ( float ) ( color & 0xff ) / byte . MaxValue ;
8484 }
8585
@@ -110,9 +110,9 @@ public Color(Color32 color)
110110
111111 public static Color FromABGR ( uint color )
112112 {
113- var a = ( float ) ( ( color >> 24 ) & 0xff ) / byte . MaxValue ;
114- var b = ( float ) ( ( color >> 16 ) & 0xff ) / byte . MaxValue ;
115- var g = ( float ) ( ( color >> 8 ) & 0xff ) / byte . MaxValue ;
113+ var a = ( float ) ( color >> 24 & 0xff ) / byte . MaxValue ;
114+ var b = ( float ) ( color >> 16 & 0xff ) / byte . MaxValue ;
115+ var g = ( float ) ( color >> 8 & 0xff ) / byte . MaxValue ;
116116 var r = ( float ) ( color & 0xff ) / byte . MaxValue ;
117117 return new Color ( r , g , b , a ) ;
118118 }
@@ -128,7 +128,7 @@ public readonly uint ToUIntRGBA()
128128 byte g = ( byte ) ( col . G * byte . MaxValue ) ;
129129 byte b = ( byte ) ( col . B * byte . MaxValue ) ;
130130 byte a = ( byte ) ( col . A * byte . MaxValue ) ;
131- return ( ( uint ) r << 24 ) | ( ( uint ) g << 16 ) | ( ( uint ) b << 8 ) | a ;
131+ return ( uint ) r << 24 | ( uint ) g << 16 | ( uint ) b << 8 | a ;
132132 }
133133
134134 /// <summary>
@@ -142,7 +142,7 @@ public readonly uint ToUIntABGR()
142142 byte g = ( byte ) ( col . G * byte . MaxValue ) ;
143143 byte b = ( byte ) ( col . B * byte . MaxValue ) ;
144144 byte a = ( byte ) ( col . A * byte . MaxValue ) ;
145- return ( ( uint ) a << 24 ) | ( ( uint ) b << 16 ) | ( ( uint ) g << 8 ) | r ;
145+ return ( uint ) a << 24 | ( uint ) b << 16 | ( uint ) g << 8 | r ;
146146 }
147147
148148 /// <summary>
@@ -170,7 +170,7 @@ public readonly ColorHSVA ToHSVA()
170170 {
171171 if ( max == R )
172172 {
173- hue = ( G - B ) / delta + ( ( G < B ) ? 6 : 0 ) ;
173+ hue = ( G - B ) / delta + ( G < B ? 6 : 0 ) ;
174174 }
175175 else if ( max == G )
176176 {
@@ -184,7 +184,7 @@ public readonly ColorHSVA ToHSVA()
184184 hue /= 6 ;
185185 }
186186
187- float saturation = ( max != 0 ) ? delta / max : 0 ;
187+ float saturation = max != 0 ? delta / max : 0 ;
188188 float value = max ;
189189
190190 return new ColorHSVA ( hue , saturation , value , A ) ;
0 commit comments