@mdgs/pivotjet 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +628 -3
- package/bin/pivotjet.mjs +122 -0
- package/dist/core.cjs +4926 -0
- package/dist/core.cjs.map +7 -0
- package/dist/index.cjs +7277 -0
- package/dist/index.cjs.map +7 -0
- package/dist/pivotjet.min.js +334 -0
- package/dist/pivotjet.min.js.map +7 -0
- package/docs/images/cell-formats.png +0 -0
- package/docs/images/chart.png +0 -0
- package/docs/images/configure-fields.png +0 -0
- package/docs/images/designer.png +0 -0
- package/docs/images/large-dataset.png +0 -0
- package/package.json +108 -4
- package/src/cellfmt.js +218 -0
- package/src/chart.js +595 -0
- package/src/core.d.ts +424 -0
- package/src/core.js +18 -0
- package/src/csv.js +198 -0
- package/src/dataset.js +404 -0
- package/src/designer.js +995 -0
- package/src/elements.js +50 -0
- package/src/engine.js +778 -0
- package/src/errors.js +2 -0
- package/src/export.js +775 -0
- package/src/expr.js +180 -0
- package/src/format.js +42 -0
- package/src/holistic.js +237 -0
- package/src/index.d.ts +155 -0
- package/src/index.js +6 -0
- package/src/layouts.js +105 -0
- package/src/node.d.ts +10 -0
- package/src/node.js +29 -0
- package/src/pdffont.js +361 -0
- package/src/remote.js +164 -0
- package/src/report-render.js +31 -0
- package/src/report.js +103 -0
- package/src/reportstore.js +135 -0
- package/src/server.d.ts +20 -0
- package/src/server.js +272 -0
- package/src/stream.js +285 -0
- package/src/styles.js +162 -0
- package/src/util.js +73 -0
- package/src/viewer.js +632 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,110 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdgs/pivotjet",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "High-performance pivot table engine, viewer and designer for very large data: 10M+ rows in the browser, 100M+ via streaming or the built-in server. Charts, Excel/PDF/CSV export, calculated fields, saved layouts. Zero dependencies, framework-agnostic (React, Vue, Angular, vanilla, web components).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./src/index.js",
|
|
8
|
+
"browser": "./dist/pivotjet.min.js",
|
|
9
|
+
"unpkg": "./dist/pivotjet.min.js",
|
|
10
|
+
"jsdelivr": "./dist/pivotjet.min.js",
|
|
11
|
+
"types": "./src/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./src/index.d.ts",
|
|
15
|
+
"import": "./src/index.js",
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./core": {
|
|
19
|
+
"types": "./src/core.d.ts",
|
|
20
|
+
"import": "./src/core.js",
|
|
21
|
+
"require": "./dist/core.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./elements": {
|
|
24
|
+
"types": "./src/index.d.ts",
|
|
25
|
+
"import": "./src/elements.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
"./server": {
|
|
29
|
+
"types": "./src/server.d.ts",
|
|
30
|
+
"import": "./src/server.js"
|
|
31
|
+
},
|
|
32
|
+
"./node": {
|
|
33
|
+
"types": "./src/node.d.ts",
|
|
34
|
+
"import": "./src/node.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"src",
|
|
39
|
+
"dist",
|
|
40
|
+
"docs/images",
|
|
41
|
+
"bin",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"sideEffects": [
|
|
46
|
+
"./src/elements.js",
|
|
47
|
+
"./dist/pivotjet.min.js"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"test": "node --test \"tests/*.test.mjs\"",
|
|
51
|
+
"build": "node scripts/build.mjs",
|
|
52
|
+
"bench": "node --max-old-space-size=4096 bench/bench.mjs",
|
|
53
|
+
"shots": "node scripts/shots.mjs",
|
|
54
|
+
"demo": "node scripts/serve.mjs",
|
|
55
|
+
"prepublishOnly": "npm test && npm run build"
|
|
56
|
+
},
|
|
57
|
+
"keywords": [
|
|
58
|
+
"pivot",
|
|
59
|
+
"pivot-table",
|
|
60
|
+
"olap",
|
|
61
|
+
"analytics",
|
|
62
|
+
"big-data",
|
|
63
|
+
"aggregation",
|
|
64
|
+
"report",
|
|
65
|
+
"designer",
|
|
66
|
+
"viewer",
|
|
67
|
+
"web-component",
|
|
68
|
+
"typed-arrays",
|
|
69
|
+
"chart",
|
|
70
|
+
"charts",
|
|
71
|
+
"excel",
|
|
72
|
+
"streaming",
|
|
73
|
+
"calculated-fields",
|
|
74
|
+
"median",
|
|
75
|
+
"distinct-count",
|
|
76
|
+
"pivottable",
|
|
77
|
+
"pivot-grid",
|
|
78
|
+
"data-grid",
|
|
79
|
+
"crosstab",
|
|
80
|
+
"react",
|
|
81
|
+
"vue",
|
|
82
|
+
"angular",
|
|
83
|
+
"svelte",
|
|
84
|
+
"csv",
|
|
85
|
+
"pdf",
|
|
86
|
+
"big-data-visualization"
|
|
87
|
+
],
|
|
88
|
+
"license": "MIT",
|
|
89
|
+
"repository": {
|
|
90
|
+
"type": "git",
|
|
91
|
+
"url": "git+https://github.com/jmanikumaran/Pivot.git"
|
|
92
|
+
},
|
|
93
|
+
"homepage": "https://github.com/jmanikumaran/Pivot#readme",
|
|
94
|
+
"bugs": {
|
|
95
|
+
"url": "https://github.com/jmanikumaran/Pivot/issues"
|
|
96
|
+
},
|
|
97
|
+
"author": "Manikumaran Jaganathan",
|
|
98
|
+
"engines": {
|
|
99
|
+
"node": ">=18"
|
|
100
|
+
},
|
|
101
|
+
"devDependencies": {
|
|
102
|
+
"esbuild": "^0.25.0"
|
|
103
|
+
},
|
|
104
|
+
"publishConfig": {
|
|
105
|
+
"access": "public"
|
|
106
|
+
},
|
|
107
|
+
"bin": {
|
|
108
|
+
"pivotjet": "bin/pivotjet.mjs"
|
|
109
|
+
}
|
|
110
|
+
}
|
package/src/cellfmt.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// Per-cell formatting rules (conditional + targeted). DOM-free; shared by the viewer, print, XLSX and PDF.
|
|
2
|
+
//
|
|
3
|
+
// A rule is plain JSON, so it saves with a layout or report:
|
|
4
|
+
// { name?, scope?: { value?, kind?, row?, col?, exact? }, when?: { op, a?, b? },
|
|
5
|
+
// format?, text?, style?: { color?, background?, bold?, italic?, underline?, align? } }
|
|
6
|
+
// scope.value value index (0-based) or the value's label / field name; omitted = every value
|
|
7
|
+
// scope.kind 'any' (default) | 'leaf' | 'sub' (subtotals) | 'grand' | 'total' (sub + grand)
|
|
8
|
+
// scope.row / scope.col label path of the row / column node, e.g. ['East'] or ['East','Widget'];
|
|
9
|
+
// matches that node and everything below it (exact:true = only that exact node)
|
|
10
|
+
// when.op > >= < <= = != between outside empty notempty (a, b = numbers)
|
|
11
|
+
// format any number format (preset name or Intl options with prefix/suffix)
|
|
12
|
+
// text literal text shown instead of the number (e.g. 'n/a')
|
|
13
|
+
// Rules apply in order; a later rule overrides the properties it sets.
|
|
14
|
+
import { makeFormatter } from './format.js';
|
|
15
|
+
import { PivotError } from './errors.js';
|
|
16
|
+
|
|
17
|
+
const KINDS = ['any', 'leaf', 'sub', 'grand', 'total'];
|
|
18
|
+
const OPS = ['>', '>=', '<', '<=', '=', '!=', 'between', 'outside', 'empty', 'notempty'];
|
|
19
|
+
const ALIGN = ['left', 'center', 'right'];
|
|
20
|
+
const COLOR = /^(#[0-9a-f]{3,8}|(?:rgb|hsl)a?\([0-9\s.,%/deg-]+\)|[a-z]{3,24})$/i;
|
|
21
|
+
|
|
22
|
+
const bad = (i, msg) => new PivotError(`Cell rule #${i + 1}: ${msg}`);
|
|
23
|
+
const color = (i, k, v) => {
|
|
24
|
+
if (typeof v !== 'string' || !COLOR.test(v.trim())) throw bad(i, `${k} must be a CSS color like #c0392b or "red", got ${JSON.stringify(v)}`);
|
|
25
|
+
return v.trim();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** Validate and normalise a list of rules (throws PivotError with a clear message). Returns plain objects. */
|
|
29
|
+
export function cleanRules(list) {
|
|
30
|
+
if (list == null) return [];
|
|
31
|
+
if (!Array.isArray(list)) throw new PivotError('cellRules must be an array');
|
|
32
|
+
return list.map((r, i) => {
|
|
33
|
+
if (!r || typeof r !== 'object') throw bad(i, 'must be an object');
|
|
34
|
+
const out = {};
|
|
35
|
+
if (r.name != null) out.name = String(r.name);
|
|
36
|
+
const sc = r.scope || {};
|
|
37
|
+
const scope = { kind: sc.kind || 'any' };
|
|
38
|
+
if (!KINDS.includes(scope.kind)) throw bad(i, `scope.kind must be one of ${KINDS.join(', ')}`);
|
|
39
|
+
if (sc.value != null) {
|
|
40
|
+
if (typeof sc.value !== 'number' && typeof sc.value !== 'string') throw bad(i, 'scope.value must be an index or a label');
|
|
41
|
+
scope.value = sc.value;
|
|
42
|
+
}
|
|
43
|
+
for (const k of ['row', 'col']) {
|
|
44
|
+
if (sc[k] == null) continue;
|
|
45
|
+
if (!Array.isArray(sc[k])) throw bad(i, `scope.${k} must be an array of labels`);
|
|
46
|
+
scope[k] = sc[k].map(String);
|
|
47
|
+
}
|
|
48
|
+
if (sc.exact) scope.exact = true;
|
|
49
|
+
out.scope = scope;
|
|
50
|
+
if (r.when) {
|
|
51
|
+
const op = r.when.op;
|
|
52
|
+
if (!OPS.includes(op)) throw bad(i, `when.op must be one of ${OPS.join(' ')}`);
|
|
53
|
+
const w = { op };
|
|
54
|
+
if (op !== 'empty' && op !== 'notempty') {
|
|
55
|
+
w.a = Number(r.when.a);
|
|
56
|
+
if (!Number.isFinite(w.a)) throw bad(i, 'when.a must be a number');
|
|
57
|
+
if (op === 'between' || op === 'outside') {
|
|
58
|
+
w.b = Number(r.when.b);
|
|
59
|
+
if (!Number.isFinite(w.b)) throw bad(i, 'when.b must be a number');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
out.when = w;
|
|
63
|
+
}
|
|
64
|
+
if (r.format != null) out.format = r.format;
|
|
65
|
+
if (r.text != null) out.text = String(r.text);
|
|
66
|
+
if (r.style) {
|
|
67
|
+
const s = {}, rs = r.style;
|
|
68
|
+
if (rs.color != null) s.color = color(i, 'style.color', rs.color);
|
|
69
|
+
const bg = rs.background ?? rs.bg;
|
|
70
|
+
if (bg != null) s.background = color(i, 'style.background', bg);
|
|
71
|
+
for (const k of ['bold', 'italic', 'underline']) if (rs[k] != null) s[k] = !!rs[k];
|
|
72
|
+
if (rs.font != null) {
|
|
73
|
+
if (typeof rs.font !== 'string' || !/^[\w .-]{1,64}$/.test(rs.font)) throw bad(i, 'style.font must be sans, serif, mono or a font family name (letters, digits, spaces)');
|
|
74
|
+
s.font = rs.font;
|
|
75
|
+
}
|
|
76
|
+
if (rs.size != null) {
|
|
77
|
+
const n = Number(rs.size);
|
|
78
|
+
if (!(n >= 5 && n <= 96)) throw bad(i, 'style.size must be between 5 and 96');
|
|
79
|
+
s.size = n;
|
|
80
|
+
}
|
|
81
|
+
if (rs.align != null) {
|
|
82
|
+
if (!ALIGN.includes(rs.align)) throw bad(i, `style.align must be one of ${ALIGN.join(', ')}`);
|
|
83
|
+
s.align = rs.align;
|
|
84
|
+
}
|
|
85
|
+
if (Object.keys(s).length) out.style = s;
|
|
86
|
+
}
|
|
87
|
+
if (!out.format && out.text == null && !out.style) throw bad(i, 'sets nothing (add a style, format or text)');
|
|
88
|
+
return out;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const FAMILY_CSS = { sans: "system-ui,-apple-system,'Segoe UI',Arial,sans-serif", serif: "Georgia,'Times New Roman',serif", mono: "ui-monospace,Consolas,'Courier New',monospace" };
|
|
93
|
+
/** CSS font-family for 'sans' | 'serif' | 'mono' | a family name (names are validated by cleanRules). */
|
|
94
|
+
export function cssFamily(f) { return FAMILY_CSS[f] || `'${String(f).replace(/[^\w .-]/g, '')}',${FAMILY_CSS.sans}`; }
|
|
95
|
+
/** Font family name used in Excel for a pivotjet family. */
|
|
96
|
+
export function officeFamily(f) { return f === 'sans' ? 'Arial' : f === 'serif' ? 'Times New Roman' : f === 'mono' ? 'Courier New' : f; }
|
|
97
|
+
|
|
98
|
+
/** CSS declarations for a normalised style object. */
|
|
99
|
+
export function styleCss(s) {
|
|
100
|
+
if (!s) return '';
|
|
101
|
+
let c = '';
|
|
102
|
+
if (s.color) c += `color:${s.color};`;
|
|
103
|
+
else if (s.background) {
|
|
104
|
+
// a fill without a text colour must stay readable on both light and dark themes
|
|
105
|
+
const rgb = parseColor(s.background);
|
|
106
|
+
if (rgb) c += `color:${(rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000 > 140 ? '#111' : '#fff'};`;
|
|
107
|
+
}
|
|
108
|
+
if (s.background) c += `background:${s.background};`;
|
|
109
|
+
if (s.bold !== undefined) c += `font-weight:${s.bold ? 700 : 400};`;
|
|
110
|
+
if (s.italic !== undefined) c += `font-style:${s.italic ? 'italic' : 'normal'};`;
|
|
111
|
+
if (s.underline) c += 'text-decoration:underline;';
|
|
112
|
+
if (s.align) c += `text-align:${s.align};`;
|
|
113
|
+
if (s.font) c += `font-family:${cssFamily(s.font)};`;
|
|
114
|
+
if (s.size) c += `font-size:${s.size}px;`;
|
|
115
|
+
return c;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function matchWhen(w, v) {
|
|
119
|
+
if (v === null || v === undefined || v !== v) return w.op === 'empty';
|
|
120
|
+
switch (w.op) {
|
|
121
|
+
case '>': return v > w.a;
|
|
122
|
+
case '>=': return v >= w.a;
|
|
123
|
+
case '<': return v < w.a;
|
|
124
|
+
case '<=': return v <= w.a;
|
|
125
|
+
case '=': return v === w.a;
|
|
126
|
+
case '!=': return v !== w.a;
|
|
127
|
+
case 'between': return v >= Math.min(w.a, w.b) && v <= Math.max(w.a, w.b);
|
|
128
|
+
case 'outside': return v < Math.min(w.a, w.b) || v > Math.max(w.a, w.b);
|
|
129
|
+
case 'notempty': return true;
|
|
130
|
+
default: return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Compile rules against a result. Returns null when there are no rules, otherwise
|
|
136
|
+
* `(rowNode, colNode, valueIndex, value) => null | { fmtFn?, fmt?, text?, style? }`.
|
|
137
|
+
*/
|
|
138
|
+
export function compileCellRules(rules, result, { locale } = {}) {
|
|
139
|
+
const list = cleanRules(rules);
|
|
140
|
+
if (!list.length) return null;
|
|
141
|
+
const vals = result.values, D = result.rowDims.length, C = result.colDims.length;
|
|
142
|
+
const rowRoot = result.rowRoot, colRoot = result.colRoot;
|
|
143
|
+
const idxOf = (v) => {
|
|
144
|
+
if (typeof v === 'number') return v >= 0 && v < vals.length ? v : -1;
|
|
145
|
+
return vals.findIndex((x) => x.label === v || x.field === v);
|
|
146
|
+
};
|
|
147
|
+
const compiled = list.map((r) => ({
|
|
148
|
+
r,
|
|
149
|
+
vi: r.scope.value === undefined ? -1 : idxOf(r.scope.value),
|
|
150
|
+
anyValue: r.scope.value === undefined,
|
|
151
|
+
fmtFn: r.format != null ? makeFormatter(r.format, locale) : null,
|
|
152
|
+
}));
|
|
153
|
+
const paths = new Map();
|
|
154
|
+
const pathOf = (n) => { let p = paths.get(n); if (!p) { p = n.level < 0 ? [] : n.path(); paths.set(n, p); } return p; };
|
|
155
|
+
const pathHit = (want, node, exact) => {
|
|
156
|
+
if (!want) return true;
|
|
157
|
+
const p = pathOf(node);
|
|
158
|
+
if (exact ? p.length !== want.length : p.length < want.length) return false;
|
|
159
|
+
for (let i = 0; i < want.length; i++) if (p[i] !== want[i]) return false;
|
|
160
|
+
return true;
|
|
161
|
+
};
|
|
162
|
+
return (rn, cn, j, v) => {
|
|
163
|
+
const grand = (D > 0 && rn === rowRoot) || (C > 0 && cn === colRoot);
|
|
164
|
+
const sub = !grand && (rn.children.length > 0 || cn.children.length > 0);
|
|
165
|
+
let out = null;
|
|
166
|
+
for (const c of compiled) {
|
|
167
|
+
const sc = c.r.scope;
|
|
168
|
+
if (!c.anyValue && c.vi !== j) continue;
|
|
169
|
+
if (sc.kind !== 'any') {
|
|
170
|
+
if (sc.kind === 'leaf' ? grand || sub : sc.kind === 'sub' ? !sub : sc.kind === 'grand' ? !grand : !(grand || sub)) continue;
|
|
171
|
+
}
|
|
172
|
+
if (c.r.when && !matchWhen(c.r.when, v)) continue;
|
|
173
|
+
if (sc.row && !pathHit(sc.row, rn, sc.exact)) continue;
|
|
174
|
+
if (sc.col && !pathHit(sc.col, cn, sc.exact)) continue;
|
|
175
|
+
if (!out) out = {};
|
|
176
|
+
if (c.fmtFn) { out.fmtFn = c.fmtFn; out.fmt = c.r.format; }
|
|
177
|
+
if (c.r.text !== undefined) out.text = c.r.text;
|
|
178
|
+
if (c.r.style) out.style = { ...out.style, ...c.r.style };
|
|
179
|
+
}
|
|
180
|
+
return out;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const NAMED = {
|
|
185
|
+
black: '000000', white: 'ffffff', red: 'ff0000', green: '008000', blue: '0000ff', yellow: 'ffff00', orange: 'ffa500',
|
|
186
|
+
purple: '800080', pink: 'ffc0cb', brown: 'a52a2a', gray: '808080', grey: '808080', silver: 'c0c0c0', gold: 'ffd700',
|
|
187
|
+
teal: '008080', navy: '000080', maroon: '800000', olive: '808000', lime: '00ff00', cyan: '00ffff', aqua: '00ffff',
|
|
188
|
+
magenta: 'ff00ff', fuchsia: 'ff00ff', crimson: 'dc143c', coral: 'ff7f50', salmon: 'fa8072', khaki: 'f0e68c',
|
|
189
|
+
indigo: '4b0082', violet: 'ee82ee', tomato: 'ff6347', lightgreen: '90ee90', lightblue: 'add8e6', lightgray: 'd3d3d3',
|
|
190
|
+
lightgrey: 'd3d3d3', darkred: '8b0000', darkgreen: '006400', darkblue: '00008b', darkgray: 'a9a9a9', darkgrey: 'a9a9a9',
|
|
191
|
+
};
|
|
192
|
+
/** CSS color -> [r,g,b] (0-255) for formats that cannot take CSS (Excel, PDF); null when it cannot be resolved. */
|
|
193
|
+
export function parseColor(str) {
|
|
194
|
+
if (typeof str !== 'string') return null;
|
|
195
|
+
const t = str.trim().toLowerCase();
|
|
196
|
+
let m = /^#([0-9a-f]{3,8})$/.exec(t);
|
|
197
|
+
if (m) {
|
|
198
|
+
let h = m[1];
|
|
199
|
+
if (h.length === 3 || h.length === 4) h = h.split('').map((c) => c + c).join('');
|
|
200
|
+
if (h.length !== 6 && h.length !== 8) return null;
|
|
201
|
+
return [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)];
|
|
202
|
+
}
|
|
203
|
+
m = /^rgba?\(([^)]+)\)$/.exec(t);
|
|
204
|
+
if (m) {
|
|
205
|
+
const p = m[1].split(/[\s,/]+/).filter(Boolean).slice(0, 3).map((x) => (x.endsWith('%') ? (parseFloat(x) * 255) / 100 : parseFloat(x)));
|
|
206
|
+
return p.length === 3 && p.every(Number.isFinite) ? p.map((x) => Math.max(0, Math.min(255, Math.round(x)))) : null;
|
|
207
|
+
}
|
|
208
|
+
m = /^hsla?\(([^)]+)\)$/.exec(t);
|
|
209
|
+
if (m) {
|
|
210
|
+
const p = m[1].split(/[\s,/]+/).filter(Boolean).slice(0, 3).map(parseFloat);
|
|
211
|
+
if (p.length !== 3 || !p.every(Number.isFinite)) return null;
|
|
212
|
+
const h = (((p[0] % 360) + 360) % 360) / 360, sl = p[1] / 100, l = p[2] / 100;
|
|
213
|
+
const q = l < 0.5 ? l * (1 + sl) : l + sl - l * sl, pp = 2 * l - q;
|
|
214
|
+
const f = (x) => { x = (x + 1) % 1; return x < 1 / 6 ? pp + (q - pp) * 6 * x : x < 0.5 ? q : x < 2 / 3 ? pp + (q - pp) * (2 / 3 - x) * 6 : pp; };
|
|
215
|
+
return [f(h + 1 / 3), f(h), f(h - 1 / 3)].map((x) => Math.round(x * 255));
|
|
216
|
+
}
|
|
217
|
+
return NAMED[t] ? parseColor('#' + NAMED[t]) : null;
|
|
218
|
+
}
|