Skip to content

Commit 7a35246

Browse files
authored
Merge pull request #38 from ziobernamac/master
Fix for ReadColor & ReadColor32
2 parents c6ed991 + d351dd3 commit 7a35246

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SimpleJSONUnity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public Color ReadColor(Color aDefault)
263263
if (IsObject)
264264
return new Color(this["r"].AsFloat, this["g"].AsFloat, this["b"].AsFloat, HasKey("a")?this["a"].AsFloat:ColorDefaultAlpha);
265265
if (IsArray)
266-
return new Color(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, (Count>4)?this[3].AsFloat:ColorDefaultAlpha);
266+
return new Color(this[0].AsFloat, this[1].AsFloat, this[2].AsFloat, (Count>3)?this[3].AsFloat:ColorDefaultAlpha);
267267
return aDefault;
268268
}
269269
public Color ReadColor()
@@ -296,7 +296,7 @@ public Color32 ReadColor32(Color32 aDefault)
296296
if (IsObject)
297297
return new Color32((byte)this["r"].AsInt, (byte)this["g"].AsInt, (byte)this["b"].AsInt, (byte)(HasKey("a")?this["a"].AsInt:Color32DefaultAlpha));
298298
if (IsArray)
299-
return new Color32((byte)this[0].AsInt, (byte)this[1].AsInt, (byte)this[2].AsInt, (byte)((Count>4)?this[3].AsInt:Color32DefaultAlpha));
299+
return new Color32((byte)this[0].AsInt, (byte)this[1].AsInt, (byte)this[2].AsInt, (byte)((Count>3)?this[3].AsInt:Color32DefaultAlpha));
300300
return aDefault;
301301
}
302302
public Color32 ReadColor32()

0 commit comments

Comments
 (0)