(color: string)
| 99 | } |
| 100 | |
| 101 | export 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 | |
| 113 | export function computeTextColor(backgroundColor: string): string { |
| 114 | const colorObj = new TinyColor(backgroundColor); |
no outgoing calls
no test coverage detected