mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 02:28:44 +08:00
[csharp] Fixed "rgb2" timeline "light" color failing to read when having hexstring length 8 instead of 6. Closes #2476.
This commit is contained in:
parent
b9b6e0d352
commit
3b8069f4b9
@ -1232,8 +1232,8 @@ namespace Spine {
|
||||
}
|
||||
|
||||
static float ToColor (string hexString, int colorIndex, int expectedLength = 8) {
|
||||
if (hexString.Length != expectedLength)
|
||||
throw new ArgumentException("Color hexidecimal length must be " + expectedLength + ", recieved: " + hexString, "hexString");
|
||||
if (hexString.Length < expectedLength)
|
||||
throw new ArgumentException("Color hexadecimal length must be " + expectedLength + ", received: " + hexString, "hexString");
|
||||
return Convert.ToInt32(hexString.Substring(colorIndex * 2, 2), 16) / (float)255;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user