From ebed2d7db063b8659f8152de97555423073332e3 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 12 Nov 2017 01:20:23 +0100 Subject: [PATCH 1/2] Add .toString() method for Color objects --- src/color.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/color.js b/src/color.js index 2f2947e16..4f2be5c3c 100644 --- a/src/color.js +++ b/src/color.js @@ -88,6 +88,10 @@ export default class Color { toJSON () { return this.alpha === 1 ? this.toHexString() : this.toRGBAString() } + + toString () { + return this.toRGBAString() + } isEqual (color) { if (this === color) { From 064a6415636f99e60c6cc0636ab6a2b04b197b24 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 12 Nov 2017 13:19:20 +0100 Subject: [PATCH 2/2] :art: --- src/color.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/color.js b/src/color.js index 4f2be5c3c..52f555076 100644 --- a/src/color.js +++ b/src/color.js @@ -88,7 +88,7 @@ export default class Color { toJSON () { return this.alpha === 1 ? this.toHexString() : this.toRGBAString() } - + toString () { return this.toRGBAString() }