emf-converter 4.4.9 → 4.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +11 -7
- package/dist/browser.mjs +11 -7
- package/dist/index.js +11 -7
- package/dist/index.mjs +11 -7
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -15735,7 +15735,7 @@ function hslToRgb(h, s, l) {
|
|
|
15735
15735
|
return [r + m, g + m, b + m];
|
|
15736
15736
|
}
|
|
15737
15737
|
var HUE_SEXTANT = 43;
|
|
15738
|
-
var HUE_CIRCLE =
|
|
15738
|
+
var HUE_CIRCLE = 255;
|
|
15739
15739
|
function gdipHue(r, g, b) {
|
|
15740
15740
|
const max = Math.max(r, g, b);
|
|
15741
15741
|
const d = max - Math.min(r, g, b);
|
|
@@ -15744,13 +15744,14 @@ function gdipHue(r, g, b) {
|
|
|
15744
15744
|
return f(g - b);
|
|
15745
15745
|
}
|
|
15746
15746
|
if (max === b && b !== r) {
|
|
15747
|
-
return r >= g ?
|
|
15747
|
+
return r >= g ? 170 + f(r - g) : 127 + f(b - g);
|
|
15748
15748
|
}
|
|
15749
15749
|
if (max === g) {
|
|
15750
|
-
return b >= r ?
|
|
15750
|
+
return b >= r ? 86 + f(b - r) : 43 + f(g - r);
|
|
15751
15751
|
}
|
|
15752
15752
|
const t = f(b - g);
|
|
15753
|
-
|
|
15753
|
+
const q = (256 - t - (t >= 40 ? 1 : 0)) % 256;
|
|
15754
|
+
return q - Math.floor((q + 42) / 86);
|
|
15754
15755
|
}
|
|
15755
15756
|
function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
15756
15757
|
const out = new Uint8ClampedArray(src);
|
|
@@ -15768,11 +15769,12 @@ function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
|
15768
15769
|
continue;
|
|
15769
15770
|
}
|
|
15770
15771
|
const sum = max + min;
|
|
15771
|
-
const s = clamp((max - min) / (sum <= 255 ? sum : 510 - sum) * sMul, 0, 1);
|
|
15772
|
+
const s = Math.fround(clamp((max - min) / (sum <= 255 ? sum : 510 - sum) * sMul, 0, 1));
|
|
15772
15773
|
const hi = l <= 127 ? l * (1 + s) : l + s * (255 - l);
|
|
15773
15774
|
const m1 = l <= 127 ? 2 * l - Math.trunc(hi) : Math.round(2 * l - hi);
|
|
15774
15775
|
const m2 = 2 * l - m1;
|
|
15775
|
-
const
|
|
15776
|
+
const index = ((gdipHue(r, g, b) + shift) % HUE_CIRCLE + HUE_CIRCLE) % HUE_CIRCLE;
|
|
15777
|
+
const q = index + Math.floor((index + 41) / 85);
|
|
15776
15778
|
const sextant = Math.min(5, Math.floor(q / HUE_SEXTANT));
|
|
15777
15779
|
const f = (q - sextant * HUE_SEXTANT) / HUE_SEXTANT;
|
|
15778
15780
|
const up = Math.trunc(m1 + (m2 - m1) * f);
|
|
@@ -15794,7 +15796,9 @@ function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
|
15794
15796
|
var LUMA_709 = [0.2126, 0.7152, 0.0722];
|
|
15795
15797
|
var TINT_CHROMA_SCALE = 0.985;
|
|
15796
15798
|
function applyTint(src, hue, amount) {
|
|
15797
|
-
const
|
|
15799
|
+
const index = (Math.round(hue * 255 / 360) + 256) % 256;
|
|
15800
|
+
const q = (index + Math.floor((index + 41) / 85)) % 258;
|
|
15801
|
+
const tint = hslToRgb(q * 60 / 43, 1, 0.5);
|
|
15798
15802
|
const ty = tint[0] * LUMA_709[0] + tint[1] * LUMA_709[1] + tint[2] * LUMA_709[2];
|
|
15799
15803
|
const chroma = tint.map((c) => (c - ty) * TINT_CHROMA_SCALE);
|
|
15800
15804
|
const a = amount / 100;
|
package/dist/browser.mjs
CHANGED
|
@@ -15733,7 +15733,7 @@ function hslToRgb(h, s, l) {
|
|
|
15733
15733
|
return [r + m, g + m, b + m];
|
|
15734
15734
|
}
|
|
15735
15735
|
var HUE_SEXTANT = 43;
|
|
15736
|
-
var HUE_CIRCLE =
|
|
15736
|
+
var HUE_CIRCLE = 255;
|
|
15737
15737
|
function gdipHue(r, g, b) {
|
|
15738
15738
|
const max = Math.max(r, g, b);
|
|
15739
15739
|
const d = max - Math.min(r, g, b);
|
|
@@ -15742,13 +15742,14 @@ function gdipHue(r, g, b) {
|
|
|
15742
15742
|
return f(g - b);
|
|
15743
15743
|
}
|
|
15744
15744
|
if (max === b && b !== r) {
|
|
15745
|
-
return r >= g ?
|
|
15745
|
+
return r >= g ? 170 + f(r - g) : 127 + f(b - g);
|
|
15746
15746
|
}
|
|
15747
15747
|
if (max === g) {
|
|
15748
|
-
return b >= r ?
|
|
15748
|
+
return b >= r ? 86 + f(b - r) : 43 + f(g - r);
|
|
15749
15749
|
}
|
|
15750
15750
|
const t = f(b - g);
|
|
15751
|
-
|
|
15751
|
+
const q = (256 - t - (t >= 40 ? 1 : 0)) % 256;
|
|
15752
|
+
return q - Math.floor((q + 42) / 86);
|
|
15752
15753
|
}
|
|
15753
15754
|
function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
15754
15755
|
const out = new Uint8ClampedArray(src);
|
|
@@ -15766,11 +15767,12 @@ function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
|
15766
15767
|
continue;
|
|
15767
15768
|
}
|
|
15768
15769
|
const sum = max + min;
|
|
15769
|
-
const s = clamp((max - min) / (sum <= 255 ? sum : 510 - sum) * sMul, 0, 1);
|
|
15770
|
+
const s = Math.fround(clamp((max - min) / (sum <= 255 ? sum : 510 - sum) * sMul, 0, 1));
|
|
15770
15771
|
const hi = l <= 127 ? l * (1 + s) : l + s * (255 - l);
|
|
15771
15772
|
const m1 = l <= 127 ? 2 * l - Math.trunc(hi) : Math.round(2 * l - hi);
|
|
15772
15773
|
const m2 = 2 * l - m1;
|
|
15773
|
-
const
|
|
15774
|
+
const index = ((gdipHue(r, g, b) + shift) % HUE_CIRCLE + HUE_CIRCLE) % HUE_CIRCLE;
|
|
15775
|
+
const q = index + Math.floor((index + 41) / 85);
|
|
15774
15776
|
const sextant = Math.min(5, Math.floor(q / HUE_SEXTANT));
|
|
15775
15777
|
const f = (q - sextant * HUE_SEXTANT) / HUE_SEXTANT;
|
|
15776
15778
|
const up = Math.trunc(m1 + (m2 - m1) * f);
|
|
@@ -15792,7 +15794,9 @@ function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
|
15792
15794
|
var LUMA_709 = [0.2126, 0.7152, 0.0722];
|
|
15793
15795
|
var TINT_CHROMA_SCALE = 0.985;
|
|
15794
15796
|
function applyTint(src, hue, amount) {
|
|
15795
|
-
const
|
|
15797
|
+
const index = (Math.round(hue * 255 / 360) + 256) % 256;
|
|
15798
|
+
const q = (index + Math.floor((index + 41) / 85)) % 258;
|
|
15799
|
+
const tint = hslToRgb(q * 60 / 43, 1, 0.5);
|
|
15796
15800
|
const ty = tint[0] * LUMA_709[0] + tint[1] * LUMA_709[1] + tint[2] * LUMA_709[2];
|
|
15797
15801
|
const chroma = tint.map((c) => (c - ty) * TINT_CHROMA_SCALE);
|
|
15798
15802
|
const a = amount / 100;
|
package/dist/index.js
CHANGED
|
@@ -15736,7 +15736,7 @@ function hslToRgb(h, s, l) {
|
|
|
15736
15736
|
return [r + m, g + m, b + m];
|
|
15737
15737
|
}
|
|
15738
15738
|
var HUE_SEXTANT = 43;
|
|
15739
|
-
var HUE_CIRCLE =
|
|
15739
|
+
var HUE_CIRCLE = 255;
|
|
15740
15740
|
function gdipHue(r, g, b) {
|
|
15741
15741
|
const max = Math.max(r, g, b);
|
|
15742
15742
|
const d = max - Math.min(r, g, b);
|
|
@@ -15745,13 +15745,14 @@ function gdipHue(r, g, b) {
|
|
|
15745
15745
|
return f(g - b);
|
|
15746
15746
|
}
|
|
15747
15747
|
if (max === b && b !== r) {
|
|
15748
|
-
return r >= g ?
|
|
15748
|
+
return r >= g ? 170 + f(r - g) : 127 + f(b - g);
|
|
15749
15749
|
}
|
|
15750
15750
|
if (max === g) {
|
|
15751
|
-
return b >= r ?
|
|
15751
|
+
return b >= r ? 86 + f(b - r) : 43 + f(g - r);
|
|
15752
15752
|
}
|
|
15753
15753
|
const t = f(b - g);
|
|
15754
|
-
|
|
15754
|
+
const q = (256 - t - (t >= 40 ? 1 : 0)) % 256;
|
|
15755
|
+
return q - Math.floor((q + 42) / 86);
|
|
15755
15756
|
}
|
|
15756
15757
|
function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
15757
15758
|
const out = new Uint8ClampedArray(src);
|
|
@@ -15769,11 +15770,12 @@ function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
|
15769
15770
|
continue;
|
|
15770
15771
|
}
|
|
15771
15772
|
const sum = max + min;
|
|
15772
|
-
const s = clamp((max - min) / (sum <= 255 ? sum : 510 - sum) * sMul, 0, 1);
|
|
15773
|
+
const s = Math.fround(clamp((max - min) / (sum <= 255 ? sum : 510 - sum) * sMul, 0, 1));
|
|
15773
15774
|
const hi = l <= 127 ? l * (1 + s) : l + s * (255 - l);
|
|
15774
15775
|
const m1 = l <= 127 ? 2 * l - Math.trunc(hi) : Math.round(2 * l - hi);
|
|
15775
15776
|
const m2 = 2 * l - m1;
|
|
15776
|
-
const
|
|
15777
|
+
const index = ((gdipHue(r, g, b) + shift) % HUE_CIRCLE + HUE_CIRCLE) % HUE_CIRCLE;
|
|
15778
|
+
const q = index + Math.floor((index + 41) / 85);
|
|
15777
15779
|
const sextant = Math.min(5, Math.floor(q / HUE_SEXTANT));
|
|
15778
15780
|
const f = (q - sextant * HUE_SEXTANT) / HUE_SEXTANT;
|
|
15779
15781
|
const up = Math.trunc(m1 + (m2 - m1) * f);
|
|
@@ -15795,7 +15797,9 @@ function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
|
15795
15797
|
var LUMA_709 = [0.2126, 0.7152, 0.0722];
|
|
15796
15798
|
var TINT_CHROMA_SCALE = 0.985;
|
|
15797
15799
|
function applyTint(src, hue, amount) {
|
|
15798
|
-
const
|
|
15800
|
+
const index = (Math.round(hue * 255 / 360) + 256) % 256;
|
|
15801
|
+
const q = (index + Math.floor((index + 41) / 85)) % 258;
|
|
15802
|
+
const tint = hslToRgb(q * 60 / 43, 1, 0.5);
|
|
15799
15803
|
const ty = tint[0] * LUMA_709[0] + tint[1] * LUMA_709[1] + tint[2] * LUMA_709[2];
|
|
15800
15804
|
const chroma = tint.map((c) => (c - ty) * TINT_CHROMA_SCALE);
|
|
15801
15805
|
const a = amount / 100;
|
package/dist/index.mjs
CHANGED
|
@@ -15734,7 +15734,7 @@ function hslToRgb(h, s, l) {
|
|
|
15734
15734
|
return [r + m, g + m, b + m];
|
|
15735
15735
|
}
|
|
15736
15736
|
var HUE_SEXTANT = 43;
|
|
15737
|
-
var HUE_CIRCLE =
|
|
15737
|
+
var HUE_CIRCLE = 255;
|
|
15738
15738
|
function gdipHue(r, g, b) {
|
|
15739
15739
|
const max = Math.max(r, g, b);
|
|
15740
15740
|
const d = max - Math.min(r, g, b);
|
|
@@ -15743,13 +15743,14 @@ function gdipHue(r, g, b) {
|
|
|
15743
15743
|
return f(g - b);
|
|
15744
15744
|
}
|
|
15745
15745
|
if (max === b && b !== r) {
|
|
15746
|
-
return r >= g ?
|
|
15746
|
+
return r >= g ? 170 + f(r - g) : 127 + f(b - g);
|
|
15747
15747
|
}
|
|
15748
15748
|
if (max === g) {
|
|
15749
|
-
return b >= r ?
|
|
15749
|
+
return b >= r ? 86 + f(b - r) : 43 + f(g - r);
|
|
15750
15750
|
}
|
|
15751
15751
|
const t = f(b - g);
|
|
15752
|
-
|
|
15752
|
+
const q = (256 - t - (t >= 40 ? 1 : 0)) % 256;
|
|
15753
|
+
return q - Math.floor((q + 42) / 86);
|
|
15753
15754
|
}
|
|
15754
15755
|
function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
15755
15756
|
const out = new Uint8ClampedArray(src);
|
|
@@ -15767,11 +15768,12 @@ function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
|
15767
15768
|
continue;
|
|
15768
15769
|
}
|
|
15769
15770
|
const sum = max + min;
|
|
15770
|
-
const s = clamp((max - min) / (sum <= 255 ? sum : 510 - sum) * sMul, 0, 1);
|
|
15771
|
+
const s = Math.fround(clamp((max - min) / (sum <= 255 ? sum : 510 - sum) * sMul, 0, 1));
|
|
15771
15772
|
const hi = l <= 127 ? l * (1 + s) : l + s * (255 - l);
|
|
15772
15773
|
const m1 = l <= 127 ? 2 * l - Math.trunc(hi) : Math.round(2 * l - hi);
|
|
15773
15774
|
const m2 = 2 * l - m1;
|
|
15774
|
-
const
|
|
15775
|
+
const index = ((gdipHue(r, g, b) + shift) % HUE_CIRCLE + HUE_CIRCLE) % HUE_CIRCLE;
|
|
15776
|
+
const q = index + Math.floor((index + 41) / 85);
|
|
15775
15777
|
const sextant = Math.min(5, Math.floor(q / HUE_SEXTANT));
|
|
15776
15778
|
const f = (q - sextant * HUE_SEXTANT) / HUE_SEXTANT;
|
|
15777
15779
|
const up = Math.trunc(m1 + (m2 - m1) * f);
|
|
@@ -15793,7 +15795,9 @@ function applyHueSaturationLightness(src, hue, saturation, lightness2) {
|
|
|
15793
15795
|
var LUMA_709 = [0.2126, 0.7152, 0.0722];
|
|
15794
15796
|
var TINT_CHROMA_SCALE = 0.985;
|
|
15795
15797
|
function applyTint(src, hue, amount) {
|
|
15796
|
-
const
|
|
15798
|
+
const index = (Math.round(hue * 255 / 360) + 256) % 256;
|
|
15799
|
+
const q = (index + Math.floor((index + 41) / 85)) % 258;
|
|
15800
|
+
const tint = hslToRgb(q * 60 / 43, 1, 0.5);
|
|
15797
15801
|
const ty = tint[0] * LUMA_709[0] + tint[1] * LUMA_709[1] + tint[2] * LUMA_709[2];
|
|
15798
15802
|
const chroma = tint.map((c) => (c - ty) * TINT_CHROMA_SCALE);
|
|
15799
15803
|
const a = amount / 100;
|