stop calc when color is opaque

This commit is contained in:
tophf 2017-12-05 20:42:13 +03:00
parent bd0f460c56
commit 36ec8de04f

View File

@ -940,6 +940,9 @@
realColor.g = Math.round(g * q1 + realColor.g * q2); realColor.g = Math.round(g * q1 + realColor.g * q2);
realColor.b = Math.round(b * q1 + realColor.b * q2); realColor.b = Math.round(b * q1 + realColor.b * q2);
realColor.a = mixedA; realColor.a = mixedA;
if (Math.abs(realColor.a - 1) < 1e-3) {
break;
}
} }
// https://www.w3.org/TR/AERT#color-contrast // https://www.w3.org/TR/AERT#color-contrast
const {r, g, b} = realColor; const {r, g, b} = realColor;