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] 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) {