mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-10 17:18:44 +08:00
Fixed toColor function returning NaN
Tested the 'toColor' function with 'ffffff00'. The returned result (in r,g,b,a) was 1,NaN,1,257. The correct result should obviously be 1,1,1,0. The hex substring was being done incorrectly.
This commit is contained in:
parent
6de19dc914
commit
c4e1b11845
@ -1,4 +1,3 @@
|
||||
|
||||
var spine = {};
|
||||
|
||||
spine.BoneData = function (name, parent) {
|
||||
@ -1078,7 +1077,7 @@ spine.SkeletonJson.readCurve = function (timeline, frameIndex, valueMap) {
|
||||
};
|
||||
spine.SkeletonJson.toColor = function (hexString, colorIndex) {
|
||||
if (hexString.length != 8) throw "Color hexidecimal length must be 8, recieved: " + hexString;
|
||||
return parseInt(hexString.substring(colorIndex * 2, 2), 16) / 255;
|
||||
return parseInt(hexString.substring(colorIndex * 2, (colorIndex * 2)+2), 16) / 255;
|
||||
};
|
||||
|
||||
spine.Atlas = function (atlasText, textureLoader) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user