@terrazzo/plugin-sass 0.9.1 → 0.10.0

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/index.js CHANGED
@@ -605,7 +605,7 @@ const definition$15$1 = {
605
605
  b: 0
606
606
  }
607
607
  };
608
- var definition_default$13$1 = definition$15$1;
608
+ var definition_default$12$1 = definition$15$1;
609
609
  const linearize$2$1 = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
610
610
  const convertA98ToXyz65$1 = (a98) => {
611
611
  let r$1 = linearize$2$1(a98.r);
@@ -694,7 +694,7 @@ const convertXyz65ToRgb$1 = ({ x, y, z, alpha }) => {
694
694
  };
695
695
  var convertXyz65ToRgb_default$1 = convertXyz65ToRgb$1;
696
696
  const definition$14$1 = {
697
- ...definition_default$13$1,
697
+ ...definition_default$12$1,
698
698
  mode: "a98",
699
699
  parse: ["a98-rgb"],
700
700
  serialize: "a98-rgb",
@@ -1011,7 +1011,7 @@ const definition$12$1 = {
1011
1011
  difference: { h: differenceHueSaturation$1 },
1012
1012
  average: { h: averageAngle$1 }
1013
1013
  };
1014
- var definition_default$2$1 = definition$12$1;
1014
+ var definition_default$15$1 = definition$12$1;
1015
1015
  function convertHwbToRgb$1({ h, w, b, alpha }) {
1016
1016
  if (w === void 0) w = 0;
1017
1017
  if (b === void 0) b = 0;
@@ -1090,7 +1090,7 @@ const definition$11$1 = {
1090
1090
  difference: { h: differenceHueNaive$1 },
1091
1091
  average: { h: averageAngle$1 }
1092
1092
  };
1093
- var definition_default$3$1 = definition$11$1;
1093
+ var definition_default$2$1 = definition$11$1;
1094
1094
  const k$1$1 = Math.pow(29, 3) / Math.pow(3, 3);
1095
1095
  const e$1$1 = Math.pow(6, 3) / Math.pow(29, 3);
1096
1096
  const D50$1 = {
@@ -1219,7 +1219,7 @@ const definition$10$1 = {
1219
1219
  }
1220
1220
  }
1221
1221
  };
1222
- var definition_default$4$1 = definition$10$1;
1222
+ var definition_default$3$1 = definition$10$1;
1223
1223
  const k$3 = Math.pow(29, 3) / Math.pow(3, 3);
1224
1224
  const e$3 = Math.pow(6, 3) / Math.pow(29, 3);
1225
1225
  let fn$4 = (v) => Math.pow(v, 3) > e$3 ? Math.pow(v, 3) : (116 * v - 16) / k$3;
@@ -1267,7 +1267,7 @@ const convertRgbToLab65$1 = (rgb$2) => {
1267
1267
  };
1268
1268
  var convertRgbToLab65_default$1 = convertRgbToLab65$1;
1269
1269
  const definition$9$1 = {
1270
- ...definition_default$4$1,
1270
+ ...definition_default$3$1,
1271
1271
  mode: "lab65",
1272
1272
  parse: ["--lab-d65"],
1273
1273
  serialize: "--lab-d65",
@@ -1285,7 +1285,7 @@ const definition$9$1 = {
1285
1285
  b: [-107.86, 94.477]
1286
1286
  }
1287
1287
  };
1288
- var definition_default$5$1 = definition$9$1;
1288
+ var definition_default$4$1 = definition$9$1;
1289
1289
  const convertLabToLch$1 = ({ l, a, b, alpha }, mode = "lch") => {
1290
1290
  if (a === void 0) a = 0;
1291
1291
  if (b === void 0) b = 0;
@@ -1367,16 +1367,16 @@ const definition$8$1 = {
1367
1367
  difference: { h: differenceHueChroma$1 },
1368
1368
  average: { h: averageAngle$1 }
1369
1369
  };
1370
- var definition_default$6$1 = definition$8$1;
1370
+ var definition_default$5$1 = definition$8$1;
1371
1371
  const definition$7$1 = {
1372
- ...definition_default$13$1,
1372
+ ...definition_default$12$1,
1373
1373
  mode: "lrgb",
1374
1374
  toMode: { rgb: convertLrgbToRgb_default$1 },
1375
1375
  fromMode: { rgb: convertRgbToLrgb_default$1 },
1376
1376
  parse: ["srgb-linear"],
1377
1377
  serialize: "srgb-linear"
1378
1378
  };
1379
- var definition_default$7$1 = definition$7$1;
1379
+ var definition_default$6$1 = definition$7$1;
1380
1380
  const convertOklabToLrgb$1 = ({ l, a, b, alpha }) => {
1381
1381
  if (l === void 0) l = 0;
1382
1382
  if (a === void 0) a = 0;
@@ -1432,7 +1432,7 @@ function parseOklab$1(color, parsed) {
1432
1432
  }
1433
1433
  var parseOklab_default$1 = parseOklab$1;
1434
1434
  const definition$6$1 = {
1435
- ...definition_default$4$1,
1435
+ ...definition_default$3$1,
1436
1436
  mode: "oklab",
1437
1437
  toMode: {
1438
1438
  lrgb: convertOklabToLrgb_default$1,
@@ -1450,7 +1450,7 @@ const definition$6$1 = {
1450
1450
  parse: [parseOklab_default$1],
1451
1451
  serialize: (c$1$1) => `oklab(${c$1$1.l !== void 0 ? c$1$1.l : "none"} ${c$1$1.a !== void 0 ? c$1$1.a : "none"} ${c$1$1.b !== void 0 ? c$1$1.b : "none"}${c$1$1.alpha < 1 ? ` / ${c$1$1.alpha}` : ""})`
1452
1452
  };
1453
- var definition_default$8$1 = definition$6$1;
1453
+ var definition_default$7$1 = definition$6$1;
1454
1454
  function parseOklch$1(color, parsed) {
1455
1455
  if (!parsed || parsed[0] !== "oklch") return void 0;
1456
1456
  const res = { mode: "oklch" };
@@ -1469,7 +1469,7 @@ function parseOklch$1(color, parsed) {
1469
1469
  }
1470
1470
  var parseOklch_default$1 = parseOklch$1;
1471
1471
  const definition$5$1 = {
1472
- ...definition_default$6$1,
1472
+ ...definition_default$5$1,
1473
1473
  mode: "oklch",
1474
1474
  toMode: {
1475
1475
  oklab: (c$1$1) => convertLchToLab_default$1(c$1$1, "oklab"),
@@ -1487,7 +1487,7 @@ const definition$5$1 = {
1487
1487
  h: [0, 360]
1488
1488
  }
1489
1489
  };
1490
- var definition_default$9$1 = definition$5$1;
1490
+ var definition_default$8$1 = definition$5$1;
1491
1491
  const convertP3ToXyz65$1 = (rgb$2) => {
1492
1492
  let { r: r$1, g, b, alpha } = convertRgbToLrgb_default$1(rgb$2);
1493
1493
  let res = {
@@ -1514,7 +1514,7 @@ const convertXyz65ToP3$1 = ({ x, y, z, alpha }) => {
1514
1514
  };
1515
1515
  var convertXyz65ToP3_default$1 = convertXyz65ToP3$1;
1516
1516
  const definition$4$1 = {
1517
- ...definition_default$13$1,
1517
+ ...definition_default$12$1,
1518
1518
  mode: "p3",
1519
1519
  parse: ["display-p3"],
1520
1520
  serialize: "display-p3",
@@ -1527,7 +1527,7 @@ const definition$4$1 = {
1527
1527
  xyz65: convertP3ToXyz65_default$1
1528
1528
  }
1529
1529
  };
1530
- var definition_default$10$1 = definition$4$1;
1530
+ var definition_default$9$1 = definition$4$1;
1531
1531
  const gamma$1$1 = (v) => {
1532
1532
  let abs = Math.abs(v);
1533
1533
  if (abs >= 1 / 512) return Math.sign(v) * Math.pow(abs, 1 / 1.8);
@@ -1567,7 +1567,7 @@ const convertProphotoToXyz50$1 = (prophoto) => {
1567
1567
  };
1568
1568
  var convertProphotoToXyz50_default$1 = convertProphotoToXyz50$1;
1569
1569
  const definition$3$1 = {
1570
- ...definition_default$13$1,
1570
+ ...definition_default$12$1,
1571
1571
  mode: "prophoto",
1572
1572
  parse: ["prophoto-rgb"],
1573
1573
  serialize: "prophoto-rgb",
@@ -1580,7 +1580,7 @@ const definition$3$1 = {
1580
1580
  rgb: (color) => convertXyz50ToRgb_default$1(convertProphotoToXyz50_default$1(color))
1581
1581
  }
1582
1582
  };
1583
- var definition_default$11$1 = definition$3$1;
1583
+ var definition_default$10$1 = definition$3$1;
1584
1584
  const α$1$1 = 1.09929682680944;
1585
1585
  const β$1$1 = .018053968510807;
1586
1586
  const gamma$3 = (v) => {
@@ -1624,7 +1624,7 @@ const convertRec2020ToXyz65$1 = (rec2020) => {
1624
1624
  };
1625
1625
  var convertRec2020ToXyz65_default$1 = convertRec2020ToXyz65$1;
1626
1626
  const definition$2$1 = {
1627
- ...definition_default$13$1,
1627
+ ...definition_default$12$1,
1628
1628
  mode: "rec2020",
1629
1629
  fromMode: {
1630
1630
  xyz65: convertXyz65ToRec2020_default$1,
@@ -1637,7 +1637,7 @@ const definition$2$1 = {
1637
1637
  parse: ["rec2020"],
1638
1638
  serialize: "rec2020"
1639
1639
  };
1640
- var definition_default$12$1 = definition$2$1;
1640
+ var definition_default$11$1 = definition$2$1;
1641
1641
  const definition$1$1 = {
1642
1642
  mode: "xyz50",
1643
1643
  parse: ["xyz-d50"],
@@ -1671,7 +1671,7 @@ const definition$1$1 = {
1671
1671
  }
1672
1672
  }
1673
1673
  };
1674
- var definition_default$14$1 = definition$1$1;
1674
+ var definition_default$13$1 = definition$1$1;
1675
1675
  const convertXyz65ToXyz50$1 = (xyz65) => {
1676
1676
  let { x, y, z, alpha } = xyz65;
1677
1677
  if (x === void 0) x = 0;
@@ -1735,7 +1735,172 @@ const definition$16 = {
1735
1735
  }
1736
1736
  }
1737
1737
  };
1738
- var definition_default$15$1 = definition$16;
1738
+ var definition_default$14$1 = definition$16;
1739
+ function toe$1(x) {
1740
+ const k_1 = .206;
1741
+ const k_2 = .03;
1742
+ const k_3 = (1 + k_1) / (1 + k_2);
1743
+ return .5 * (k_3 * x - k_1 + Math.sqrt((k_3 * x - k_1) * (k_3 * x - k_1) + 4 * k_2 * k_3 * x));
1744
+ }
1745
+ function toe_inv$1(x) {
1746
+ const k_1 = .206;
1747
+ const k_2 = .03;
1748
+ const k_3 = (1 + k_1) / (1 + k_2);
1749
+ return (x * x + k_1 * x) / (k_3 * (x + k_2));
1750
+ }
1751
+ function compute_max_saturation$1(a, b) {
1752
+ let k0, k1, k2, k3, k4, wl, wm, ws;
1753
+ if (-1.88170328 * a - .80936493 * b > 1) {
1754
+ k0 = 1.19086277;
1755
+ k1 = 1.76576728;
1756
+ k2 = .59662641;
1757
+ k3 = .75515197;
1758
+ k4 = .56771245;
1759
+ wl = 4.0767416621;
1760
+ wm = -3.3077115913;
1761
+ ws = .2309699292;
1762
+ } else if (1.81444104 * a - 1.19445276 * b > 1) {
1763
+ k0 = .73956515;
1764
+ k1 = -.45954404;
1765
+ k2 = .08285427;
1766
+ k3 = .1254107;
1767
+ k4 = .14503204;
1768
+ wl = -1.2684380046;
1769
+ wm = 2.6097574011;
1770
+ ws = -.3413193965;
1771
+ } else {
1772
+ k0 = 1.35733652;
1773
+ k1 = -.00915799;
1774
+ k2 = -1.1513021;
1775
+ k3 = -.50559606;
1776
+ k4 = .00692167;
1777
+ wl = -.0041960863;
1778
+ wm = -.7034186147;
1779
+ ws = 1.707614701;
1780
+ }
1781
+ let S = k0 + k1 * a + k2 * b + k3 * a * a + k4 * a * b;
1782
+ let k_l = .3963377774 * a + .2158037573 * b;
1783
+ let k_m = -.1055613458 * a - .0638541728 * b;
1784
+ let k_s = -.0894841775 * a - 1.291485548 * b;
1785
+ {
1786
+ let l_ = 1 + S * k_l;
1787
+ let m_ = 1 + S * k_m;
1788
+ let s_ = 1 + S * k_s;
1789
+ let l = l_ * l_ * l_;
1790
+ let m = m_ * m_ * m_;
1791
+ let s = s_ * s_ * s_;
1792
+ let l_dS = 3 * k_l * l_ * l_;
1793
+ let m_dS = 3 * k_m * m_ * m_;
1794
+ let s_dS = 3 * k_s * s_ * s_;
1795
+ let l_dS2 = 6 * k_l * k_l * l_;
1796
+ let m_dS2 = 6 * k_m * k_m * m_;
1797
+ let s_dS2 = 6 * k_s * k_s * s_;
1798
+ let f$2$1 = wl * l + wm * m + ws * s;
1799
+ let f1 = wl * l_dS + wm * m_dS + ws * s_dS;
1800
+ let f2 = wl * l_dS2 + wm * m_dS2 + ws * s_dS2;
1801
+ S = S - f$2$1 * f1 / (f1 * f1 - .5 * f$2$1 * f2);
1802
+ }
1803
+ return S;
1804
+ }
1805
+ function find_cusp$1(a, b) {
1806
+ let S_cusp = compute_max_saturation$1(a, b);
1807
+ let rgb$2 = convertOklabToLrgb_default$1({
1808
+ l: 1,
1809
+ a: S_cusp * a,
1810
+ b: S_cusp * b
1811
+ });
1812
+ let L_cusp = Math.cbrt(1 / Math.max(rgb$2.r, rgb$2.g, rgb$2.b));
1813
+ let C_cusp = L_cusp * S_cusp;
1814
+ return [L_cusp, C_cusp];
1815
+ }
1816
+ function get_ST_max$1(a_, b_, cusp = null) {
1817
+ if (!cusp) cusp = find_cusp$1(a_, b_);
1818
+ let L = cusp[0];
1819
+ let C = cusp[1];
1820
+ return [C / L, C / (1 - L)];
1821
+ }
1822
+ function convertOklabToOkhsv$1(lab) {
1823
+ let l = lab.l !== void 0 ? lab.l : 0;
1824
+ let a = lab.a !== void 0 ? lab.a : 0;
1825
+ let b = lab.b !== void 0 ? lab.b : 0;
1826
+ let c$1$1 = Math.sqrt(a * a + b * b);
1827
+ let a_ = c$1$1 ? a / c$1$1 : 1;
1828
+ let b_ = c$1$1 ? b / c$1$1 : 1;
1829
+ let [S_max, T] = get_ST_max$1(a_, b_);
1830
+ let S_0 = .5;
1831
+ let k$3$1 = 1 - S_0 / S_max;
1832
+ let t = T / (c$1$1 + l * T);
1833
+ let L_v = t * l;
1834
+ let C_v = t * c$1$1;
1835
+ let L_vt = toe_inv$1(L_v);
1836
+ let C_vt = C_v * L_vt / L_v;
1837
+ let rgb_scale = convertOklabToLrgb_default$1({
1838
+ l: L_vt,
1839
+ a: a_ * C_vt,
1840
+ b: b_ * C_vt
1841
+ });
1842
+ let scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
1843
+ l = l / scale_L;
1844
+ c$1$1 = c$1$1 / scale_L * toe$1(l) / l;
1845
+ l = toe$1(l);
1846
+ const ret = {
1847
+ mode: "okhsv",
1848
+ s: c$1$1 ? (S_0 + T) * C_v / (T * S_0 + T * k$3$1 * C_v) : 0,
1849
+ v: l ? l / L_v : 0
1850
+ };
1851
+ if (ret.s) ret.h = normalizeHue_default$1(Math.atan2(b, a) * 180 / Math.PI);
1852
+ if (lab.alpha !== void 0) ret.alpha = lab.alpha;
1853
+ return ret;
1854
+ }
1855
+ function convertOkhsvToOklab$1(hsv) {
1856
+ const ret = { mode: "oklab" };
1857
+ if (hsv.alpha !== void 0) ret.alpha = hsv.alpha;
1858
+ const h = hsv.h !== void 0 ? hsv.h : 0;
1859
+ const s = hsv.s !== void 0 ? hsv.s : 0;
1860
+ const v = hsv.v !== void 0 ? hsv.v : 0;
1861
+ const a_ = Math.cos(h / 180 * Math.PI);
1862
+ const b_ = Math.sin(h / 180 * Math.PI);
1863
+ const [S_max, T] = get_ST_max$1(a_, b_);
1864
+ const S_0 = .5;
1865
+ const k$3$1 = 1 - S_0 / S_max;
1866
+ const L_v = 1 - s * S_0 / (S_0 + T - T * k$3$1 * s);
1867
+ const C_v = s * T * S_0 / (S_0 + T - T * k$3$1 * s);
1868
+ const L_vt = toe_inv$1(L_v);
1869
+ const C_vt = C_v * L_vt / L_v;
1870
+ const rgb_scale = convertOklabToLrgb_default$1({
1871
+ l: L_vt,
1872
+ a: a_ * C_vt,
1873
+ b: b_ * C_vt
1874
+ });
1875
+ const scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
1876
+ const L_new = toe_inv$1(v * L_v);
1877
+ const C = C_v * L_new / L_v;
1878
+ ret.l = L_new * scale_L;
1879
+ ret.a = C * a_ * scale_L;
1880
+ ret.b = C * b_ * scale_L;
1881
+ return ret;
1882
+ }
1883
+ const modeOkhsv$1 = {
1884
+ ...definition_default$15$1,
1885
+ mode: "okhsv",
1886
+ channels: [
1887
+ "h",
1888
+ "s",
1889
+ "v",
1890
+ "alpha"
1891
+ ],
1892
+ parse: ["--okhsv"],
1893
+ serialize: "--okhsv",
1894
+ fromMode: {
1895
+ oklab: convertOklabToOkhsv$1,
1896
+ rgb: (c$1$1) => convertOklabToOkhsv$1(convertRgbToOklab_default$1(c$1$1))
1897
+ },
1898
+ toMode: {
1899
+ oklab: convertOkhsvToOklab$1,
1900
+ rgb: (c$1$1) => convertOklabToRgb_default$1(convertOkhsvToOklab$1(c$1$1))
1901
+ }
1902
+ };
1903
+ var modeOkhsv_default$1 = modeOkhsv$1;
1739
1904
  const r = (value, precision) => Math.round(value * (precision = Math.pow(10, precision))) / precision;
1740
1905
  const round = (precision = 4) => (value) => typeof value === "number" ? r(value, precision) : value;
1741
1906
  var round_default = round;
@@ -1746,20 +1911,20 @@ const rgb = converter_default$1("rgb");
1746
1911
  const converters$2 = {
1747
1912
  a98: useMode$1(definition_default$16),
1748
1913
  hsl: useMode$1(definition_default$1$1),
1749
- hsv: useMode$1(definition_default$2$1),
1750
- hwb: useMode$1(definition_default$3$1),
1751
- lab: useMode$1(definition_default$4$1),
1752
- lab65: useMode$1(definition_default$5$1),
1753
- lch: useMode$1(definition_default$6$1),
1754
- lrgb: useMode$1(definition_default$7$1),
1755
- oklab: useMode$1(definition_default$8$1),
1756
- oklch: useMode$1(definition_default$9$1),
1757
- p3: useMode$1(definition_default$10$1),
1758
- prophoto: useMode$1(definition_default$11$1),
1759
- rec2020: useMode$1(definition_default$12$1),
1760
- rgb: useMode$1(definition_default$13$1),
1761
- xyz50: useMode$1(definition_default$14$1),
1762
- xyz65: useMode$1(definition_default$15$1)
1914
+ hwb: useMode$1(definition_default$2$1),
1915
+ lab: useMode$1(definition_default$3$1),
1916
+ lab65: useMode$1(definition_default$4$1),
1917
+ lch: useMode$1(definition_default$5$1),
1918
+ lrgb: useMode$1(definition_default$6$1),
1919
+ oklab: useMode$1(definition_default$7$1),
1920
+ oklch: useMode$1(definition_default$8$1),
1921
+ okhsv: useMode$1(modeOkhsv_default$1),
1922
+ p3: useMode$1(definition_default$9$1),
1923
+ prophoto: useMode$1(definition_default$10$1),
1924
+ rec2020: useMode$1(definition_default$11$1),
1925
+ rgb: useMode$1(definition_default$12$1),
1926
+ xyz50: useMode$1(definition_default$13$1),
1927
+ xyz65: useMode$1(definition_default$14$1)
1763
1928
  };
1764
1929
  const FORMAT_ID = "css";
1765
1930
 
@@ -2419,7 +2584,7 @@ const definition$15 = {
2419
2584
  b: 0
2420
2585
  }
2421
2586
  };
2422
- var definition_default$13 = definition$15;
2587
+ var definition_default$12 = definition$15;
2423
2588
 
2424
2589
  //#endregion
2425
2590
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/a98/convertA98ToXyz65.js
@@ -2529,7 +2694,7 @@ var convertXyz65ToRgb_default = convertXyz65ToRgb;
2529
2694
  //#endregion
2530
2695
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/a98/definition.js
2531
2696
  const definition$14 = {
2532
- ...definition_default$13,
2697
+ ...definition_default$12,
2533
2698
  mode: "a98",
2534
2699
  parse: ["a98-rgb"],
2535
2700
  serialize: "a98-rgb",
@@ -2885,7 +3050,7 @@ const definition$12 = {
2885
3050
  difference: { h: differenceHueSaturation },
2886
3051
  average: { h: averageAngle }
2887
3052
  };
2888
- var definition_default$2 = definition$12;
3053
+ var definition_default$15 = definition$12;
2889
3054
 
2890
3055
  //#endregion
2891
3056
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hwb/convertHwbToRgb.js
@@ -2976,7 +3141,7 @@ const definition$11 = {
2976
3141
  difference: { h: differenceHueNaive },
2977
3142
  average: { h: averageAngle }
2978
3143
  };
2979
- var definition_default$3 = definition$11;
3144
+ var definition_default$2 = definition$11;
2980
3145
 
2981
3146
  //#endregion
2982
3147
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/constants.js
@@ -3135,7 +3300,7 @@ const definition$10 = {
3135
3300
  }
3136
3301
  }
3137
3302
  };
3138
- var definition_default$4 = definition$10;
3303
+ var definition_default$3 = definition$10;
3139
3304
 
3140
3305
  //#endregion
3141
3306
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/constants.js
@@ -3201,7 +3366,7 @@ var convertRgbToLab65_default = convertRgbToLab65;
3201
3366
  //#endregion
3202
3367
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/definition.js
3203
3368
  const definition$9 = {
3204
- ...definition_default$4,
3369
+ ...definition_default$3,
3205
3370
  mode: "lab65",
3206
3371
  parse: ["--lab-d65"],
3207
3372
  serialize: "--lab-d65",
@@ -3219,7 +3384,7 @@ const definition$9 = {
3219
3384
  b: [-107.86, 94.477]
3220
3385
  }
3221
3386
  };
3222
- var definition_default$5 = definition$9;
3387
+ var definition_default$4 = definition$9;
3223
3388
 
3224
3389
  //#endregion
3225
3390
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lch/convertLabToLch.js
@@ -3313,19 +3478,19 @@ const definition$8 = {
3313
3478
  difference: { h: differenceHueChroma },
3314
3479
  average: { h: averageAngle }
3315
3480
  };
3316
- var definition_default$6 = definition$8;
3481
+ var definition_default$5 = definition$8;
3317
3482
 
3318
3483
  //#endregion
3319
3484
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lrgb/definition.js
3320
3485
  const definition$7 = {
3321
- ...definition_default$13,
3486
+ ...definition_default$12,
3322
3487
  mode: "lrgb",
3323
3488
  toMode: { rgb: convertLrgbToRgb_default },
3324
3489
  fromMode: { rgb: convertRgbToLrgb_default },
3325
3490
  parse: ["srgb-linear"],
3326
3491
  serialize: "srgb-linear"
3327
3492
  };
3328
- var definition_default$7 = definition$7;
3493
+ var definition_default$6 = definition$7;
3329
3494
 
3330
3495
  //#endregion
3331
3496
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertOklabToLrgb.js
@@ -3399,7 +3564,7 @@ var parseOklab_default = parseOklab;
3399
3564
  //#endregion
3400
3565
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/definition.js
3401
3566
  const definition$6 = {
3402
- ...definition_default$4,
3567
+ ...definition_default$3,
3403
3568
  mode: "oklab",
3404
3569
  toMode: {
3405
3570
  lrgb: convertOklabToLrgb_default,
@@ -3417,7 +3582,7 @@ const definition$6 = {
3417
3582
  parse: [parseOklab_default],
3418
3583
  serialize: (c$2) => `oklab(${c$2.l !== void 0 ? c$2.l : "none"} ${c$2.a !== void 0 ? c$2.a : "none"} ${c$2.b !== void 0 ? c$2.b : "none"}${c$2.alpha < 1 ? ` / ${c$2.alpha}` : ""})`
3419
3584
  };
3420
- var definition_default$8 = definition$6;
3585
+ var definition_default$7 = definition$6;
3421
3586
 
3422
3587
  //#endregion
3423
3588
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklch/parseOklch.js
@@ -3442,7 +3607,7 @@ var parseOklch_default = parseOklch;
3442
3607
  //#endregion
3443
3608
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklch/definition.js
3444
3609
  const definition$5 = {
3445
- ...definition_default$6,
3610
+ ...definition_default$5,
3446
3611
  mode: "oklch",
3447
3612
  toMode: {
3448
3613
  oklab: (c$2) => convertLchToLab_default(c$2, "oklab"),
@@ -3460,7 +3625,7 @@ const definition$5 = {
3460
3625
  h: [0, 360]
3461
3626
  }
3462
3627
  };
3463
- var definition_default$9 = definition$5;
3628
+ var definition_default$8 = definition$5;
3464
3629
 
3465
3630
  //#endregion
3466
3631
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/convertP3ToXyz65.js
@@ -3496,7 +3661,7 @@ var convertXyz65ToP3_default = convertXyz65ToP3;
3496
3661
  //#endregion
3497
3662
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/definition.js
3498
3663
  const definition$4 = {
3499
- ...definition_default$13,
3664
+ ...definition_default$12,
3500
3665
  mode: "p3",
3501
3666
  parse: ["display-p3"],
3502
3667
  serialize: "display-p3",
@@ -3509,7 +3674,7 @@ const definition$4 = {
3509
3674
  xyz65: convertP3ToXyz65_default
3510
3675
  }
3511
3676
  };
3512
- var definition_default$10 = definition$4;
3677
+ var definition_default$9 = definition$4;
3513
3678
 
3514
3679
  //#endregion
3515
3680
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
@@ -3558,7 +3723,7 @@ var convertProphotoToXyz50_default = convertProphotoToXyz50;
3558
3723
  //#endregion
3559
3724
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/definition.js
3560
3725
  const definition$3 = {
3561
- ...definition_default$13,
3726
+ ...definition_default$12,
3562
3727
  mode: "prophoto",
3563
3728
  parse: ["prophoto-rgb"],
3564
3729
  serialize: "prophoto-rgb",
@@ -3571,7 +3736,7 @@ const definition$3 = {
3571
3736
  rgb: (color) => convertXyz50ToRgb_default(convertProphotoToXyz50_default(color))
3572
3737
  }
3573
3738
  };
3574
- var definition_default$11 = definition$3;
3739
+ var definition_default$10 = definition$3;
3575
3740
 
3576
3741
  //#endregion
3577
3742
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
@@ -3624,7 +3789,7 @@ var convertRec2020ToXyz65_default = convertRec2020ToXyz65;
3624
3789
  //#endregion
3625
3790
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/definition.js
3626
3791
  const definition$2 = {
3627
- ...definition_default$13,
3792
+ ...definition_default$12,
3628
3793
  mode: "rec2020",
3629
3794
  fromMode: {
3630
3795
  xyz65: convertXyz65ToRec2020_default,
@@ -3637,7 +3802,7 @@ const definition$2 = {
3637
3802
  parse: ["rec2020"],
3638
3803
  serialize: "rec2020"
3639
3804
  };
3640
- var definition_default$12 = definition$2;
3805
+ var definition_default$11 = definition$2;
3641
3806
 
3642
3807
  //#endregion
3643
3808
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/definition.js
@@ -3674,7 +3839,7 @@ const definition$1 = {
3674
3839
  }
3675
3840
  }
3676
3841
  };
3677
- var definition_default$14 = definition$1;
3842
+ var definition_default$13 = definition$1;
3678
3843
 
3679
3844
  //#endregion
3680
3845
  //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
@@ -3747,7 +3912,184 @@ const definition = {
3747
3912
  }
3748
3913
  }
3749
3914
  };
3750
- var definition_default$15 = definition;
3915
+ var definition_default$14 = definition;
3916
+
3917
+ //#endregion
3918
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/okhsl/helpers.js
3919
+ function toe(x) {
3920
+ const k_1 = .206;
3921
+ const k_2 = .03;
3922
+ const k_3 = (1 + k_1) / (1 + k_2);
3923
+ return .5 * (k_3 * x - k_1 + Math.sqrt((k_3 * x - k_1) * (k_3 * x - k_1) + 4 * k_2 * k_3 * x));
3924
+ }
3925
+ function toe_inv(x) {
3926
+ const k_1 = .206;
3927
+ const k_2 = .03;
3928
+ const k_3 = (1 + k_1) / (1 + k_2);
3929
+ return (x * x + k_1 * x) / (k_3 * (x + k_2));
3930
+ }
3931
+ function compute_max_saturation(a, b) {
3932
+ let k0, k1, k2, k3, k4, wl, wm, ws;
3933
+ if (-1.88170328 * a - .80936493 * b > 1) {
3934
+ k0 = 1.19086277;
3935
+ k1 = 1.76576728;
3936
+ k2 = .59662641;
3937
+ k3 = .75515197;
3938
+ k4 = .56771245;
3939
+ wl = 4.0767416621;
3940
+ wm = -3.3077115913;
3941
+ ws = .2309699292;
3942
+ } else if (1.81444104 * a - 1.19445276 * b > 1) {
3943
+ k0 = .73956515;
3944
+ k1 = -.45954404;
3945
+ k2 = .08285427;
3946
+ k3 = .1254107;
3947
+ k4 = .14503204;
3948
+ wl = -1.2684380046;
3949
+ wm = 2.6097574011;
3950
+ ws = -.3413193965;
3951
+ } else {
3952
+ k0 = 1.35733652;
3953
+ k1 = -.00915799;
3954
+ k2 = -1.1513021;
3955
+ k3 = -.50559606;
3956
+ k4 = .00692167;
3957
+ wl = -.0041960863;
3958
+ wm = -.7034186147;
3959
+ ws = 1.707614701;
3960
+ }
3961
+ let S = k0 + k1 * a + k2 * b + k3 * a * a + k4 * a * b;
3962
+ let k_l = .3963377774 * a + .2158037573 * b;
3963
+ let k_m = -.1055613458 * a - .0638541728 * b;
3964
+ let k_s = -.0894841775 * a - 1.291485548 * b;
3965
+ {
3966
+ let l_ = 1 + S * k_l;
3967
+ let m_ = 1 + S * k_m;
3968
+ let s_ = 1 + S * k_s;
3969
+ let l = l_ * l_ * l_;
3970
+ let m = m_ * m_ * m_;
3971
+ let s = s_ * s_ * s_;
3972
+ let l_dS = 3 * k_l * l_ * l_;
3973
+ let m_dS = 3 * k_m * m_ * m_;
3974
+ let s_dS = 3 * k_s * s_ * s_;
3975
+ let l_dS2 = 6 * k_l * k_l * l_;
3976
+ let m_dS2 = 6 * k_m * k_m * m_;
3977
+ let s_dS2 = 6 * k_s * k_s * s_;
3978
+ let f$3 = wl * l + wm * m + ws * s;
3979
+ let f1 = wl * l_dS + wm * m_dS + ws * s_dS;
3980
+ let f2 = wl * l_dS2 + wm * m_dS2 + ws * s_dS2;
3981
+ S = S - f$3 * f1 / (f1 * f1 - .5 * f$3 * f2);
3982
+ }
3983
+ return S;
3984
+ }
3985
+ function find_cusp(a, b) {
3986
+ let S_cusp = compute_max_saturation(a, b);
3987
+ let rgb$2 = convertOklabToLrgb_default({
3988
+ l: 1,
3989
+ a: S_cusp * a,
3990
+ b: S_cusp * b
3991
+ });
3992
+ let L_cusp = Math.cbrt(1 / Math.max(rgb$2.r, rgb$2.g, rgb$2.b));
3993
+ let C_cusp = L_cusp * S_cusp;
3994
+ return [L_cusp, C_cusp];
3995
+ }
3996
+ function get_ST_max(a_, b_, cusp = null) {
3997
+ if (!cusp) cusp = find_cusp(a_, b_);
3998
+ let L = cusp[0];
3999
+ let C = cusp[1];
4000
+ return [C / L, C / (1 - L)];
4001
+ }
4002
+
4003
+ //#endregion
4004
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/okhsv/convertOklabToOkhsv.js
4005
+ function convertOklabToOkhsv(lab) {
4006
+ let l = lab.l !== void 0 ? lab.l : 0;
4007
+ let a = lab.a !== void 0 ? lab.a : 0;
4008
+ let b = lab.b !== void 0 ? lab.b : 0;
4009
+ let c$2 = Math.sqrt(a * a + b * b);
4010
+ let a_ = c$2 ? a / c$2 : 1;
4011
+ let b_ = c$2 ? b / c$2 : 1;
4012
+ let [S_max, T] = get_ST_max(a_, b_);
4013
+ let S_0 = .5;
4014
+ let k$4 = 1 - S_0 / S_max;
4015
+ let t = T / (c$2 + l * T);
4016
+ let L_v = t * l;
4017
+ let C_v = t * c$2;
4018
+ let L_vt = toe_inv(L_v);
4019
+ let C_vt = C_v * L_vt / L_v;
4020
+ let rgb_scale = convertOklabToLrgb_default({
4021
+ l: L_vt,
4022
+ a: a_ * C_vt,
4023
+ b: b_ * C_vt
4024
+ });
4025
+ let scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
4026
+ l = l / scale_L;
4027
+ c$2 = c$2 / scale_L * toe(l) / l;
4028
+ l = toe(l);
4029
+ const ret = {
4030
+ mode: "okhsv",
4031
+ s: c$2 ? (S_0 + T) * C_v / (T * S_0 + T * k$4 * C_v) : 0,
4032
+ v: l ? l / L_v : 0
4033
+ };
4034
+ if (ret.s) ret.h = normalizeHue_default(Math.atan2(b, a) * 180 / Math.PI);
4035
+ if (lab.alpha !== void 0) ret.alpha = lab.alpha;
4036
+ return ret;
4037
+ }
4038
+
4039
+ //#endregion
4040
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/okhsv/convertOkhsvToOklab.js
4041
+ function convertOkhsvToOklab(hsv) {
4042
+ const ret = { mode: "oklab" };
4043
+ if (hsv.alpha !== void 0) ret.alpha = hsv.alpha;
4044
+ const h = hsv.h !== void 0 ? hsv.h : 0;
4045
+ const s = hsv.s !== void 0 ? hsv.s : 0;
4046
+ const v = hsv.v !== void 0 ? hsv.v : 0;
4047
+ const a_ = Math.cos(h / 180 * Math.PI);
4048
+ const b_ = Math.sin(h / 180 * Math.PI);
4049
+ const [S_max, T] = get_ST_max(a_, b_);
4050
+ const S_0 = .5;
4051
+ const k$4 = 1 - S_0 / S_max;
4052
+ const L_v = 1 - s * S_0 / (S_0 + T - T * k$4 * s);
4053
+ const C_v = s * T * S_0 / (S_0 + T - T * k$4 * s);
4054
+ const L_vt = toe_inv(L_v);
4055
+ const C_vt = C_v * L_vt / L_v;
4056
+ const rgb_scale = convertOklabToLrgb_default({
4057
+ l: L_vt,
4058
+ a: a_ * C_vt,
4059
+ b: b_ * C_vt
4060
+ });
4061
+ const scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
4062
+ const L_new = toe_inv(v * L_v);
4063
+ const C = C_v * L_new / L_v;
4064
+ ret.l = L_new * scale_L;
4065
+ ret.a = C * a_ * scale_L;
4066
+ ret.b = C * b_ * scale_L;
4067
+ return ret;
4068
+ }
4069
+
4070
+ //#endregion
4071
+ //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/okhsv/modeOkhsv.js
4072
+ const modeOkhsv = {
4073
+ ...definition_default$15,
4074
+ mode: "okhsv",
4075
+ channels: [
4076
+ "h",
4077
+ "s",
4078
+ "v",
4079
+ "alpha"
4080
+ ],
4081
+ parse: ["--okhsv"],
4082
+ serialize: "--okhsv",
4083
+ fromMode: {
4084
+ oklab: convertOklabToOkhsv,
4085
+ rgb: (c$2) => convertOklabToOkhsv(convertRgbToOklab_default(c$2))
4086
+ },
4087
+ toMode: {
4088
+ oklab: convertOkhsvToOklab,
4089
+ rgb: (c$2) => convertOklabToRgb_default(convertOkhsvToOklab(c$2))
4090
+ }
4091
+ };
4092
+ var modeOkhsv_default = modeOkhsv;
3751
4093
 
3752
4094
  //#endregion
3753
4095
  //#region ../token-tools/dist/css.js
@@ -3766,20 +4108,20 @@ function makeCSSVar(name, { prefix, wrapVar = false } = {}) {
3766
4108
  const converters = {
3767
4109
  a98: useMode(definition_default),
3768
4110
  hsl: useMode(definition_default$1),
3769
- hsv: useMode(definition_default$2),
3770
- hwb: useMode(definition_default$3),
3771
- lab: useMode(definition_default$4),
3772
- lab65: useMode(definition_default$5),
3773
- lch: useMode(definition_default$6),
3774
- lrgb: useMode(definition_default$7),
3775
- oklab: useMode(definition_default$8),
3776
- oklch: useMode(definition_default$9),
3777
- p3: useMode(definition_default$10),
3778
- prophoto: useMode(definition_default$11),
3779
- rec2020: useMode(definition_default$12),
3780
- rgb: useMode(definition_default$13),
3781
- xyz50: useMode(definition_default$14),
3782
- xyz65: useMode(definition_default$15)
4111
+ hwb: useMode(definition_default$2),
4112
+ lab: useMode(definition_default$3),
4113
+ lab65: useMode(definition_default$4),
4114
+ lch: useMode(definition_default$5),
4115
+ lrgb: useMode(definition_default$6),
4116
+ oklab: useMode(definition_default$7),
4117
+ oklch: useMode(definition_default$8),
4118
+ okhsv: useMode(modeOkhsv_default),
4119
+ p3: useMode(definition_default$9),
4120
+ prophoto: useMode(definition_default$10),
4121
+ rec2020: useMode(definition_default$11),
4122
+ rgb: useMode(definition_default$12),
4123
+ xyz50: useMode(definition_default$13),
4124
+ xyz65: useMode(definition_default$14)
3783
4125
  };
3784
4126
 
3785
4127
  //#endregion