From c37bec5b9cd6a28f2ae1b090ea70290db9b2f893 Mon Sep 17 00:00:00 2001 From: gameu3d Date: Fri, 10 May 2019 14:34:27 +0800 Subject: [PATCH] fix color multiply bug (#4401) --- cocos/core/value-types/color.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/core/value-types/color.ts b/cocos/core/value-types/color.ts index a5011de695..90bcc19a94 100644 --- a/cocos/core/value-types/color.ts +++ b/cocos/core/value-types/color.ts @@ -516,7 +516,7 @@ export default class Color extends ValueType { const r = ((this._val & 0x000000ff) * c.r) >> 8; const g = ((this._val & 0x0000ff00) * c.g) >> 8; const b = ((this._val & 0x00ff0000) * c.b) >> 8; - const a = ((this._val & 0xff000000) >> 8) * c.a; + const a = ((this._val & 0xff000000) >>> 8) * c.a; this._val = (a & 0xff000000) | (b & 0x00ff0000) | (g & 0x0000ff00) | (r & 0x000000ff); return this; } @@ -526,7 +526,7 @@ export default class Color extends ValueType { const r = ((this._val & 0x000000ff) * c.r) >> 8; const g = ((this._val & 0x0000ff00) * c.g) >> 8; const b = ((this._val & 0x00ff0000) * c.b) >> 8; - const a = ((this._val & 0xff000000) >> 8) * c.a; + const a = ((this._val & 0xff000000) >>> 8) * c.a; out._val = (a & 0xff000000) | (b & 0x00ff0000) | (g & 0x0000ff00) | (r & 0x000000ff); return out; }