From be0f644f95142b6071f6d12a1731fa6c68977e91 Mon Sep 17 00:00:00 2001 From: zxg0622 <247274249@qq.com> Date: Tue, 30 Apr 2019 10:54:27 +0800 Subject: [PATCH] fix color calc error (#4345) --- cocos/core/value-types/color.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/core/value-types/color.ts b/cocos/core/value-types/color.ts index bb2c54bbc0..a5011de695 100644 --- a/cocos/core/value-types/color.ts +++ b/cocos/core/value-types/color.ts @@ -523,10 +523,10 @@ export default class Color extends ValueType { public mul (c: Color, out?: Color) { out = out || new Color(); - const r = ((out._val & 0x000000ff) * c.r) >> 8; - const g = ((out._val & 0x0000ff00) * c.g) >> 8; - const b = ((out._val & 0x00ff0000) * c.b) >> 8; - const a = ((out._val & 0xff000000) >> 8) * c.a; + 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; out._val = (a & 0xff000000) | (b & 0x00ff0000) | (g & 0x0000ff00) | (r & 0x000000ff); return out; }