MCPcopy
hub / github.com/RomRider/apexcharts-card / computeColor

Function computeColor

src/utils.ts:101–111  ·  view source on GitHub ↗
(color: string)

Source from the content-addressed store, hash-verified

99}
100
101export function computeColor(color: string): string {
102 if (color[0] === '#') {
103 return new TinyColor(color).toHexString();
104 } else if (color.substring(0, 3) === 'var') {
105 return new TinyColor(
106 window.getComputedStyle(document.documentElement).getPropertyValue(color.substring(4).slice(0, -1)).trim(),
107 ).toHexString();
108 } else {
109 return new TinyColor(color).toHexString();
110 }
111}
112
113export function computeTextColor(backgroundColor: string): string {
114 const colorObj = new TinyColor(backgroundColor);

Callers 7

_updateDataFunction · 0.90
_getPointAnnotationStyleFunction · 0.90
_computeNowAnnotationFunction · 0.90
apexcharts-card.tsFile · 0.90
ifFunction · 0.90
computeColorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected