@opendata-ai/openchart-core 8.0.0-rc.20 → 8.0.0-rc.22

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
@@ -1541,7 +1541,7 @@ function _luminanceFromHex(color2) {
1541
1541
  function adaptTheme(theme) {
1542
1542
  const pairs = theme._tokenPairs;
1543
1543
  const inputBg = theme.colors.background;
1544
- const isTransparent = inputBg === "transparent";
1544
+ const isTransparent = !isOpaqueColor(inputBg);
1545
1545
  const alreadyDark = isTransparent || _luminanceFromHex(inputBg) < 0.2;
1546
1546
  const darkBg = pairs?.["colors.background"] ? pairs["colors.background"].dark : alreadyDark ? inputBg : DARK_BG;
1547
1547
  const darkMuted = ACHROMATIC_RAMP.fgMuted;
@@ -1786,7 +1786,7 @@ function relativeLuminance2(hex2) {
1786
1786
  return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);
1787
1787
  }
1788
1788
  function isDarkBackground(hex2) {
1789
- if (hex2 === "transparent") return false;
1789
+ if (!isOpaqueColor(hex2)) return false;
1790
1790
  return relativeLuminance2(hex2) < 0.2;
1791
1791
  }
1792
1792
  function adaptChromeForDarkBg(theme, textColor) {