Skip to content

Commit d0ec5e4

Browse files
committed
Fix bug of Color.webToColor and Color.updateColor
Color.webToColor and Color.updateColor should update out.color and out.color32 property.
1 parent a4c4c64 commit d0ec5e4

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/utils/Color.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,6 @@ Phaser.Color = {
441441

442442
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: '' };
443443

444-
out.color = Phaser.Color.getColor(out.r, out.g, out.b);
445-
out.color32 = Phaser.Color.getColor32(out.a, out.r, out.g, out.b);
446-
447444
return Phaser.Color.updateColor(out);
448445

449446
},
@@ -459,6 +456,8 @@ Phaser.Color = {
459456
updateColor: function (out) {
460457

461458
out.rgba = 'rgba(' + out.r.toString() + ',' + out.g.toString() + ',' + out.b.toString() + ',' + out.a.toString() + ')';
459+
out.color = Phaser.Color.getColor(out.r, out.g, out.b);
460+
out.color32 = Phaser.Color.getColor32(out.a, out.r, out.g, out.b);
462461

463462
return out;
464463

@@ -615,6 +614,7 @@ Phaser.Color = {
615614
out.g = parseInt(result[2], 10);
616615
out.b = parseInt(result[3], 10);
617616
out.a = result[4] !== undefined ? parseFloat(result[4]) : 1;
617+
Phaser.Color.updateColor(out);
618618
}
619619

620620
return out;

0 commit comments

Comments
 (0)