From 36ec8de04f2d470dfef43e7527e2ba261560f367 Mon Sep 17 00:00:00 2001 From: tophf Date: Tue, 5 Dec 2017 20:42:13 +0300 Subject: [PATCH] stop calc when color is opaque --- vendor-overwrites/colorpicker/colorpicker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendor-overwrites/colorpicker/colorpicker.js b/vendor-overwrites/colorpicker/colorpicker.js index f18e0c85..d52c1fec 100644 --- a/vendor-overwrites/colorpicker/colorpicker.js +++ b/vendor-overwrites/colorpicker/colorpicker.js @@ -940,6 +940,9 @@ realColor.g = Math.round(g * q1 + realColor.g * q2); realColor.b = Math.round(b * q1 + realColor.b * q2); realColor.a = mixedA; + if (Math.abs(realColor.a - 1) < 1e-3) { + break; + } } // https://www.w3.org/TR/AERT#color-contrast const {r, g, b} = realColor;