Skip to content

Commit f336066

Browse files
committed
Init cc.Color with default alpha value as 255
1 parent f807921 commit f336066

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cocos2d/core/platform/CCTypes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ cc.Color = function (r, g, b, a) {
3737
r = r || 0;
3838
g = g || 0;
3939
b = b || 0;
40-
a = a || 0;
40+
a = typeof a === 'number' ? a : 255;
4141
this._val = ((r << 24) >>> 0) + (g << 16) + (b << 8) + a;
4242
};
4343

0 commit comments

Comments
 (0)