diff --git a/src/core/utils/index.js b/src/core/utils/index.js index d6bac52..5f0da0f 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -489,9 +489,9 @@ export function premultiplyTintToRgba(tint, alpha, out, premultiply) { out = out || new Float32Array(4); - out[0] = ((tint >> 16) & 0xFF); - out[1] = ((tint >> 8) & 0xFF); - out[2] = (tint & 0xFF); + out[0] = ((tint >> 16) & 0xFF) / 255.0; + out[1] = ((tint >> 8) & 0xFF) / 255.0; + out[2] = (tint & 0xFF) / 255.0; if (premultiply || premultiply === undefined) { out[0] *= alpha; diff --git a/src/core/utils/index.js b/src/core/utils/index.js index d6bac52..5f0da0f 100644 --- a/src/core/utils/index.js +++ b/src/core/utils/index.js @@ -489,9 +489,9 @@ export function premultiplyTintToRgba(tint, alpha, out, premultiply) { out = out || new Float32Array(4); - out[0] = ((tint >> 16) & 0xFF); - out[1] = ((tint >> 8) & 0xFF); - out[2] = (tint & 0xFF); + out[0] = ((tint >> 16) & 0xFF) / 255.0; + out[1] = ((tint >> 8) & 0xFF) / 255.0; + out[2] = (tint & 0xFF) / 255.0; if (premultiply || premultiply === undefined) { out[0] *= alpha; diff --git a/src/extras/webgl/TilingSpriteRenderer.js b/src/extras/webgl/TilingSpriteRenderer.js index 1225730..e29c1a4 100644 --- a/src/extras/webgl/TilingSpriteRenderer.js +++ b/src/extras/webgl/TilingSpriteRenderer.js @@ -140,7 +140,7 @@ } shader.uniforms.uTransform = tempMat.toArray(true); - shader.uniforms.uColor = core.utils.premultiplyTint(ts.tint, ts.worldAlpha, + shader.uniforms.uColor = core.utils.premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, baseTex.premultiplyAlpha); shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);