Permalink
Browse files

Make sure to convert incoming 3B colors into the correct format

  • Loading branch information...
1 parent 859f72a commit b1ab4cb4a14b51abae55e6ed860e5d62b493e42f Ivo Wetzel committed Feb 5, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 cocos2d/particle_nodes/CCParticleSystem.js
View
8 cocos2d/particle_nodes/CCParticleSystem.js
@@ -846,6 +846,8 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
* @param {cc.Color4F} startColor
*/
setStartColor:function (startColor) {
+ if (startColor instanceof cc.Color3B)
+ startColor = cc.c4FFromccc3B(startColor);
this._startColor = startColor;
},
@@ -863,6 +865,8 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
* @param {cc.Color4F} startColorVar
*/
setStartColorVar:function (startColorVar) {
+ if (startColorVar instanceof cc.Color3B)
+ startColorVar = cc.c4FFromccc3B(startColorVar);
this._startColorVar = startColorVar;
},
@@ -881,6 +885,8 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
* @param {cc.Color4F} endColor
*/
setEndColor:function (endColor) {
+ if (endColor instanceof cc.Color3B)
+ endColor = cc.c4FFromccc3B(endColor);
this._endColor = endColor;
},
@@ -898,6 +904,8 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
* @param {cc.Color4F} endColorVar
*/
setEndColorVar:function (endColorVar) {
+ if (endColorVar instanceof cc.Color3B)
+ endColorVar = cc.c4FFromccc3B(endColorVar);
this._endColorVar = endColorVar;
},

0 comments on commit b1ab4cb

Please sign in to comment.