@@ -13,27 +13,27 @@ public struct Color
1313
1414 public float grayscale => 0.299f * r + 0.587f * g + 0.114f * b ;
1515
16- public static Color black => new Color ( 0f , 0f , 0f , 1f ) ;
16+ public static Color black => new ( 0f , 0f , 0f , 1f ) ;
1717
18- public static Color blue => new Color ( 0f , 0f , 1f , 1f ) ;
18+ public static Color blue => new ( 0f , 0f , 1f , 1f ) ;
1919
20- public static Color clear => new Color ( 0f , 0f , 0f , 0f ) ;
20+ public static Color clear => new ( 0f , 0f , 0f , 0f ) ;
2121
22- public static Color cyan => new Color ( 0f , 1f , 1f , 1f ) ;
22+ public static Color cyan => new ( 0f , 1f , 1f , 1f ) ;
2323
24- public static Color gray => new Color ( 0.5f , 0.5f , 0.5f , 1f ) ;
24+ public static Color gray => new ( 0.5f , 0.5f , 0.5f , 1f ) ;
2525
26- public static Color green => new Color ( 0f , 1f , 0f , 1f ) ;
26+ public static Color green => new ( 0f , 1f , 0f , 1f ) ;
2727
28- public static Color grey => new Color ( 0.5f , 0.5f , 0.5f , 1f ) ;
28+ public static Color grey => new ( 0.5f , 0.5f , 0.5f , 1f ) ;
2929
30- public static Color magenta => new Color ( 1f , 0f , 1f , 1f ) ;
30+ public static Color magenta => new ( 1f , 0f , 1f , 1f ) ;
3131
32- public static Color red => new Color ( 1f , 0f , 0f , 1f ) ;
32+ public static Color red => new ( 1f , 0f , 0f , 1f ) ;
3333
34- public static Color white => new Color ( 1f , 1f , 1f , 1f ) ;
34+ public static Color white => new ( 1f , 1f , 1f , 1f ) ;
3535
36- public static Color yellow => new Color ( 1f , 0.9215f , 0.0156f , 1f ) ;
36+ public static Color yellow => new ( 1f , 0.9215f , 0.0156f , 1f ) ;
3737
3838 public float this [ int index ]
3939 {
@@ -121,7 +121,7 @@ public static Color FromHSV(float h, float s, float v, float a = 1)
121121 float t = v * ( 1 - s * ( 1 - f ) ) ;
122122
123123 // build our rgb color
124- Color color = new Color ( 0 , 0 , 0 , a ) ;
124+ Color color = new ( 0 , 0 , 0 , a ) ;
125125
126126 switch ( i )
127127 {
@@ -165,27 +165,27 @@ public static Color FromHSV(float h, float s, float v, float a = 1)
165165 return color ;
166166 }
167167
168- public static Color operator + ( Color a , Color b ) => new Color ( a . r + b . r , a . g + b . g , a . b + b . b , a . a + b . a ) ;
168+ public static Color operator + ( Color a , Color b ) => new ( a . r + b . r , a . g + b . g , a . b + b . b , a . a + b . a ) ;
169169
170- public static Color operator / ( Color a , float b ) => new Color ( a . r / b , a . g / b , a . b / b , a . a / b ) ;
170+ public static Color operator / ( Color a , float b ) => new ( a . r / b , a . g / b , a . b / b , a . a / b ) ;
171171
172- public static bool operator == ( Color lhs , Color rhs ) => lhs == rhs ;
172+ public static bool operator == ( Color lhs , Color rhs ) => lhs . Equals ( rhs ) ;
173173
174- public static implicit operator Vector4 ( Color c ) => new Vector4 ( c . r , c . g , c . b , c . a ) ;
175- public static implicit operator System . Numerics . Vector4 ( Color c ) => new System . Numerics . Vector4 ( c . r , c . g , c . b , c . a ) ;
174+ public static implicit operator Vector4 ( Color c ) => new ( c . r , c . g , c . b , c . a ) ;
175+ public static implicit operator System . Numerics . Vector4 ( Color c ) => new ( c . r , c . g , c . b , c . a ) ;
176176
177- public static implicit operator Color ( Vector4 v ) => new Color ( ( float ) v . x , ( float ) v . y , ( float ) v . z , ( float ) v . w ) ;
178- public static implicit operator Color ( System . Numerics . Vector4 v ) => new Color ( v . X , v . Y , v . Z , v . W ) ;
177+ public static implicit operator Color ( Vector4 v ) => new ( ( float ) v . x , ( float ) v . y , ( float ) v . z , ( float ) v . w ) ;
178+ public static implicit operator Color ( System . Numerics . Vector4 v ) => new ( v . X , v . Y , v . Z , v . W ) ;
179179
180- public static bool operator != ( Color lhs , Color rhs ) => lhs != rhs ;
180+ public static bool operator != ( Color lhs , Color rhs ) => ! lhs . Equals ( rhs ) ;
181181
182- public static Color operator * ( Color a , Color b ) => new Color ( a . r * b . r , a . g * b . g , a . b * b . b , a . a * b . a ) ;
182+ public static Color operator * ( Color a , Color b ) => new ( a . r * b . r , a . g * b . g , a . b * b . b , a . a * b . a ) ;
183183
184- public static Color operator * ( Color a , float b ) => new Color ( a . r * b , a . g * b , a . b * b , a . a * b ) ;
184+ public static Color operator * ( Color a , float b ) => new ( a . r * b , a . g * b , a . b * b , a . a * b ) ;
185185
186- public static Color operator * ( float b , Color a ) => new Color ( a . r * b , a . g * b , a . b * b , a . a * b ) ;
186+ public static Color operator * ( float b , Color a ) => new ( a . r * b , a . g * b , a . b * b , a . a * b ) ;
187187
188- public static Color operator - ( Color a , Color b ) => new Color ( a . r - b . r , a . g - b . g , a . b - b . b , a . a - b . a ) ;
188+ public static Color operator - ( Color a , Color b ) => new ( a . r - b . r , a . g - b . g , a . b - b . b , a . a - b . a ) ;
189189
190190 public override bool Equals ( object ? other )
191191 {
0 commit comments