Versie 0.2.0
This commit is contained in:
commit
e77d8fd373
495 files changed
+81026
No files matched your search
@@ -0,0 +1,28 @@
|
||||
// Generated, do not edit. sha256:39cef5d1d7c6691e4a7d1766d7878d7b1a1aa62aaa034e47b2930230f92c8080
|
||||
import { CONFIG } from '../../shared/config.js';
|
||||
import { t } from '../i18n/index.js';
|
||||
import { loadCharting as loadSharedCharting, readPalette as readSharedPalette, tintSeries } from './charting.js';
|
||||
|
||||
export function loadCharting() {
|
||||
const c = CONFIG.CHART_LIBS;
|
||||
if (!c || !c.CHARTJS || !c.HAMMER || !c.ZOOM) {
|
||||
throw new Error('Chart libs are missing in shared/config.js (CHART_LIBS).');
|
||||
}
|
||||
return loadSharedCharting(c, { failed: src => t('integrations.scriptLoadFailed', { src }) });
|
||||
}
|
||||
|
||||
export function readPalette() {
|
||||
const cs = getComputedStyle(document.documentElement);
|
||||
const v = n => cs.getPropertyValue(n).trim();
|
||||
const shared = readSharedPalette();
|
||||
const [, mid, faint] = tintSeries(shared.accent, 3, { min: 0.45 });
|
||||
return {
|
||||
...shared,
|
||||
border: v('--border'), accentMid: mid, accentFaint: faint, blue: v('--sig-blue'),
|
||||
red: v('--sig-red'), sigGreen: v('--sig-green'), sigYellow: v('--sig-yellow'), sigRed: v('--sig-red'),
|
||||
greenZone: v('--sig-green-zone'), yellowZone: v('--sig-yellow-zone'), redZone: v('--sig-red-zone'),
|
||||
ringSeam: parseFloat(v('--ring-seam')) || 0,
|
||||
ringSheen: v('--ring-sheen') === '1',
|
||||
hairline: v('--hairline'), rimBottom: v('--rim-bottom'), accentGlow: v('--accent-glow'),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user