Merge branch '4.1' into 4.2-beta

This commit is contained in:
Harald Csaszar 2024-03-07 18:27:08 +01:00
commit f84022a730

View File

@ -1335,8 +1335,8 @@ namespace Spine {
} }
static float ToColor (string hexString, int colorIndex, int expectedLength = 8) { static float ToColor (string hexString, int colorIndex, int expectedLength = 8) {
if (hexString.Length != expectedLength) if (hexString.Length < expectedLength)
throw new ArgumentException("Color hexidecimal length must be " + expectedLength + ", recieved: " + hexString, "hexString"); throw new ArgumentException("Color hexadecimal length must be " + expectedLength + ", received: " + hexString, "hexString");
return Convert.ToInt32(hexString.Substring(colorIndex * 2, 2), 16) / (float)255; return Convert.ToInt32(hexString.Substring(colorIndex * 2, 2), 16) / (float)255;
} }