From d0ec5e4060a5b1e57e58975e14291f351cfbaa12 Mon Sep 17 00:00:00 2001 From: cuixiping Date: Thu, 9 Apr 2015 12:14:20 +0800 Subject: [PATCH] Fix bug of Color.webToColor and Color.updateColor Color.webToColor and Color.updateColor should update out.color and out.color32 property. --- src/utils/Color.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/Color.js b/src/utils/Color.js index 488480548..474c2b14c 100644 --- a/src/utils/Color.js +++ b/src/utils/Color.js @@ -441,9 +441,6 @@ Phaser.Color = { var out = { r: r || 0, g: g || 0, b: b || 0, a: a || 1, h: h || 0, s: s || 0, l: l || 0, v: v || 0, color: 0, color32: 0, rgba: '' }; - out.color = Phaser.Color.getColor(out.r, out.g, out.b); - out.color32 = Phaser.Color.getColor32(out.a, out.r, out.g, out.b); - return Phaser.Color.updateColor(out); }, @@ -459,6 +456,8 @@ Phaser.Color = { updateColor: function (out) { out.rgba = 'rgba(' + out.r.toString() + ',' + out.g.toString() + ',' + out.b.toString() + ',' + out.a.toString() + ')'; + out.color = Phaser.Color.getColor(out.r, out.g, out.b); + out.color32 = Phaser.Color.getColor32(out.a, out.r, out.g, out.b); return out; @@ -615,6 +614,7 @@ Phaser.Color = { out.g = parseInt(result[2], 10); out.b = parseInt(result[3], 10); out.a = result[4] !== undefined ? parseFloat(result[4]) : 1; + Phaser.Color.updateColor(out); } return out;