We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f807921 commit f336066Copy full SHA for f336066
cocos2d/core/platform/CCTypes.js
@@ -37,7 +37,7 @@ cc.Color = function (r, g, b, a) {
37
r = r || 0;
38
g = g || 0;
39
b = b || 0;
40
- a = a || 0;
+ a = typeof a === 'number' ? a : 255;
41
this._val = ((r << 24) >>> 0) + (g << 16) + (b << 8) + a;
42
};
43
0 commit comments