From 58f4fbec4193e58764d84dfda4732e196f5c1040 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 17 Apr 2018 22:34:55 +0300 Subject: [PATCH] colorConverter.format: use color.type by default --- vendor-overwrites/colorpicker/colorconverter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vendor-overwrites/colorpicker/colorconverter.js b/vendor-overwrites/colorpicker/colorconverter.js index ad206239..6129d59d 100644 --- a/vendor-overwrites/colorpicker/colorconverter.js +++ b/vendor-overwrites/colorpicker/colorconverter.js @@ -16,7 +16,8 @@ const colorConverter = (() => { // NAMED_COLORS is added below }; - function format(color, type, hexUppercase) { + function format(color = '', type = color.type, hexUppercase) { + if (!color || !type) return ''; const a = formatAlpha(color.a); const hasA = Boolean(a); if (type === 'rgb' && color.type === 'hsl') {