From 3b8069f4b91cc05329147c372446cd5b54e0f5dd Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 7 Mar 2024 18:15:16 +0100 Subject: [PATCH] [csharp] Fixed "rgb2" timeline "light" color failing to read when having hexstring length 8 instead of 6. Closes #2476. --- spine-csharp/src/SkeletonJson.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spine-csharp/src/SkeletonJson.cs b/spine-csharp/src/SkeletonJson.cs index 7f65c7b56..2601c68c6 100644 --- a/spine-csharp/src/SkeletonJson.cs +++ b/spine-csharp/src/SkeletonJson.cs @@ -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; } }