From 1cd3fefa88f36c6fc49cb183392a2a1e02d5ca81 Mon Sep 17 00:00:00 2001 From: Serhii Yaschuk Date: Fri, 17 Mar 2023 23:35:58 +0200 Subject: [PATCH] Fixed issue with new @pixi/color --- packages/base/src/SpineBase.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/base/src/SpineBase.ts b/packages/base/src/SpineBase.ts index 544f4b3f..5b5464b3 100644 --- a/packages/base/src/SpineBase.ts +++ b/packages/base/src/SpineBase.ts @@ -11,8 +11,6 @@ import { Graphics } from '@pixi/graphics'; import { settings } from './settings'; import type { ISpineDebugRenderer } from './SpineDebugRenderer'; -const tempRgb = [0, 0, 0]; - /** * @public */ @@ -322,10 +320,11 @@ export abstract class SpineBase< // YAY! double - tint! spriteColor = slot.currentSprite.color; } else { - tempRgb[0] = light[0] * slot.color.r * attColor.r; - tempRgb[1] = light[1] * slot.color.g * attColor.g; - tempRgb[2] = light[2] * slot.color.b * attColor.b; - slot.currentSprite.tint = utils.rgb2hex(tempRgb); + slot.currentSprite.tint = utils.rgb2hex([ + light[0] * slot.color.r * attColor.r, + light[1] * slot.color.g * attColor.g, + light[2] * slot.color.b * attColor.b + ]); } slot.currentSprite.blendMode = slot.blendMode; break; @@ -380,10 +379,11 @@ export abstract class SpineBase< // pixi-heaven spriteColor = slot.currentMesh.color; } else { - tempRgb[0] = light[0] * slot.color.r * attColor.r; - tempRgb[1] = light[1] * slot.color.g * attColor.g; - tempRgb[2] = light[2] * slot.color.b * attColor.b; - slot.currentMesh.tint = utils.rgb2hex(tempRgb); + slot.currentMesh.tint = utils.rgb2hex([ + light[0] * slot.color.r * attColor.r, + light[1] * slot.color.g * attColor.g, + light[2] * slot.color.b * attColor.b + ]); } slot.currentMesh.blendMode = slot.blendMode; if (!slot.hackRegion) {