added new method to convert byte array to lower case hex-string
added unit test update ToHex(byte[]) to support mono added punctuations to unit test summary and parameter description Replaced with Convert.ToHexString(), public ToHex() + use from Color.ToString() Adjusted back to a simpler mono compatible version only, with lowered allocation
This commit is contained in:
@@ -224,9 +224,9 @@ namespace OpenRA.Primitives
|
||||
public override string ToString()
|
||||
{
|
||||
if (A == 255)
|
||||
return R.ToStringInvariant("X2") + G.ToStringInvariant("X2") + B.ToStringInvariant("X2");
|
||||
return CryptoUtil.ToHex(stackalloc byte[3] { R, G, B });
|
||||
|
||||
return R.ToStringInvariant("X2") + G.ToStringInvariant("X2") + B.ToStringInvariant("X2") + A.ToStringInvariant("X2");
|
||||
return CryptoUtil.ToHex(stackalloc byte[4] { R, G, B, A });
|
||||
}
|
||||
|
||||
public static Color Transparent => FromArgb(0x00FFFFFF);
|
||||
|
||||
Reference in New Issue
Block a user