@telosnex/monet-ui 0.0.0-stage → 0.1.1
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 +69 -2
- package/dist/afterimage.d.ts +41 -0
- package/dist/afterimage.js +204 -0
- package/dist/afterimage.js.map +1 -0
- package/dist/apca-tone-bounds-data.d.ts +2 -0
- package/dist/apca-tone-bounds-data.js +809 -0
- package/dist/apca-tone-bounds-data.js.map +1 -0
- package/dist/cam16-v11.d.ts +78 -0
- package/dist/cam16-v11.js +229 -0
- package/dist/cam16-v11.js.map +1 -0
- package/dist/color.d.ts +9 -0
- package/dist/color.js +31 -0
- package/dist/color.js.map +1 -0
- package/dist/contrast.d.ts +109 -0
- package/dist/contrast.js +517 -0
- package/dist/contrast.js.map +1 -0
- package/dist/css-vars.d.ts +11 -0
- package/dist/css-vars.js +58 -0
- package/dist/css-vars.js.map +1 -0
- package/dist/extract.d.ts +57 -0
- package/dist/extract.js +261 -0
- package/dist/extract.js.map +1 -0
- package/dist/hct.d.ts +28 -0
- package/dist/hct.js +442 -0
- package/dist/hct.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/lerp.d.ts +58 -0
- package/dist/lerp.js +118 -0
- package/dist/lerp.js.map +1 -0
- package/dist/lru-cache.d.ts +17 -0
- package/dist/lru-cache.js +50 -0
- package/dist/lru-cache.js.map +1 -0
- package/dist/luma.d.ts +10 -0
- package/dist/luma.js +93 -0
- package/dist/luma.js.map +1 -0
- package/dist/math.d.ts +2 -0
- package/dist/math.js +13 -0
- package/dist/math.js.map +1 -0
- package/dist/oklch.d.ts +11 -0
- package/dist/oklch.js +61 -0
- package/dist/oklch.js.map +1 -0
- package/dist/over-image.d.ts +162 -0
- package/dist/over-image.js +440 -0
- package/dist/over-image.js.map +1 -0
- package/dist/palette-snapshot.d.ts +63 -0
- package/dist/palette-snapshot.js +93 -0
- package/dist/palette-snapshot.js.map +1 -0
- package/dist/palette.d.ts +129 -0
- package/dist/palette.js +295 -0
- package/dist/palette.js.map +1 -0
- package/dist/point-provider-lab.d.ts +7 -0
- package/dist/point-provider-lab.js +16 -0
- package/dist/point-provider-lab.js.map +1 -0
- package/dist/point-provider.d.ts +6 -0
- package/dist/point-provider.js +2 -0
- package/dist/point-provider.js.map +1 -0
- package/dist/quantize-worker.d.ts +36 -0
- package/dist/quantize-worker.js +81 -0
- package/dist/quantize-worker.js.map +1 -0
- package/dist/quantizer-celebi.d.ts +7 -0
- package/dist/quantizer-celebi.js +25 -0
- package/dist/quantizer-celebi.js.map +1 -0
- package/dist/quantizer-map.d.ts +5 -0
- package/dist/quantizer-map.js +19 -0
- package/dist/quantizer-map.js.map +1 -0
- package/dist/quantizer-wsmeans.d.ts +21 -0
- package/dist/quantizer-wsmeans.js +569 -0
- package/dist/quantizer-wsmeans.js.map +1 -0
- package/dist/quantizer-wu.d.ts +52 -0
- package/dist/quantizer-wu.js +319 -0
- package/dist/quantizer-wu.js.map +1 -0
- package/dist/size-scale.d.ts +1 -0
- package/dist/size-scale.js +4 -0
- package/dist/size-scale.js.map +1 -0
- package/dist/temperature.d.ts +66 -0
- package/dist/temperature.js +169 -0
- package/dist/temperature.js.map +1 -0
- package/dist/theme.d.ts +33 -0
- package/dist/theme.js +66 -0
- package/dist/theme.js.map +1 -0
- package/dist/uv-harmony.d.ts +23 -0
- package/dist/uv-harmony.js +248 -0
- package/dist/uv-harmony.js.map +1 -0
- package/dist/xyz-lab.d.ts +8 -0
- package/dist/xyz-lab.js +50 -0
- package/dist/xyz-lab.js.map +1 -0
- package/package.json +41 -4
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { type ColorModel } from './hct.js';
|
|
2
|
+
import { type Argb } from './color.js';
|
|
3
|
+
import { Algo } from './contrast.js';
|
|
4
|
+
export interface PaletteOptions {
|
|
5
|
+
backgroundTone: number;
|
|
6
|
+
contrast?: number;
|
|
7
|
+
algo?: Algo;
|
|
8
|
+
colorModel?: ColorModel;
|
|
9
|
+
}
|
|
10
|
+
export interface PaletteWithBackgroundOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Original logical CIE L* shared by independently tinted backgrounds.
|
|
13
|
+
* Omit for a distinct explicit surface; its measured tone then defines its
|
|
14
|
+
* own foreground-polarity context.
|
|
15
|
+
*/
|
|
16
|
+
backgroundTone?: number;
|
|
17
|
+
contrast?: number;
|
|
18
|
+
algo?: Algo;
|
|
19
|
+
colorModel?: ColorModel;
|
|
20
|
+
}
|
|
21
|
+
export type PaletteRole = 'background' | 'backgroundText' | 'backgroundFill' | 'backgroundBorder' | 'backgroundHovered' | 'backgroundSplashed' | 'backgroundHoveredFill' | 'backgroundSplashedFill' | 'backgroundHoveredText' | 'backgroundSplashedText' | 'backgroundHoveredBorder' | 'backgroundSplashedBorder' | 'color' | 'colorText' | 'colorIcon' | 'colorHovered' | 'colorSplashed' | 'colorHoveredText' | 'colorSplashedText' | 'colorHoveredIcon' | 'colorSplashedIcon' | 'colorBorder' | 'colorHoveredBorder' | 'colorSplashedBorder' | 'fill' | 'fillText' | 'fillIcon' | 'fillHovered' | 'fillSplashed' | 'fillHoveredText' | 'fillSplashedText' | 'fillHoveredIcon' | 'fillSplashedIcon' | 'fillBorder' | 'fillHoveredBorder' | 'fillSplashedBorder' | 'text' | 'textHovered' | 'textSplashed' | 'textHoveredText' | 'textSplashedText';
|
|
22
|
+
export declare const paletteRoles: readonly PaletteRole[];
|
|
23
|
+
export declare class Palette {
|
|
24
|
+
private readonly baseColor;
|
|
25
|
+
private readonly baseBackground;
|
|
26
|
+
private readonly backgroundToneOverride;
|
|
27
|
+
private readonly contrast;
|
|
28
|
+
private readonly algo;
|
|
29
|
+
readonly colorModel: ColorModel;
|
|
30
|
+
static from(color: Argb, options: PaletteOptions): Palette;
|
|
31
|
+
static fromColorAndBackground(color: Argb, background: Argb, options?: PaletteWithBackgroundOptions): Palette;
|
|
32
|
+
private readonly colorHct;
|
|
33
|
+
private readonly backgroundHct;
|
|
34
|
+
private readonly colorHue;
|
|
35
|
+
private readonly colorChroma;
|
|
36
|
+
private readonly colorTone;
|
|
37
|
+
private readonly backgroundHue;
|
|
38
|
+
private readonly backgroundChroma;
|
|
39
|
+
private readonly backgroundTone;
|
|
40
|
+
private readonly cache;
|
|
41
|
+
private constructor();
|
|
42
|
+
private solve;
|
|
43
|
+
private withColorsChroma;
|
|
44
|
+
private withBackgroundsChroma;
|
|
45
|
+
private memo;
|
|
46
|
+
private directionFor;
|
|
47
|
+
private get bgDirection();
|
|
48
|
+
private get bgTextTone();
|
|
49
|
+
private get textTone();
|
|
50
|
+
private get fillDirection();
|
|
51
|
+
private get fillTextTone();
|
|
52
|
+
private get colorDirection();
|
|
53
|
+
private get colorTextTone();
|
|
54
|
+
private get hoverDial();
|
|
55
|
+
private get splashDial();
|
|
56
|
+
private get borderContrast();
|
|
57
|
+
private get fgContrast();
|
|
58
|
+
private get bgFillTone();
|
|
59
|
+
private get bgHoverTone();
|
|
60
|
+
private get bgSplashTone();
|
|
61
|
+
private get colorHoverTone();
|
|
62
|
+
private get colorSplashTone();
|
|
63
|
+
private get fillHoverTone();
|
|
64
|
+
private get fillSplashTone();
|
|
65
|
+
private get bgHoverDirection();
|
|
66
|
+
private get bgHoverTextTone();
|
|
67
|
+
private get bgSplashDirection();
|
|
68
|
+
private get bgSplashTextTone();
|
|
69
|
+
private get colorHoverDirection();
|
|
70
|
+
private get colorHoverTextTone();
|
|
71
|
+
private get colorSplashDirection();
|
|
72
|
+
private get colorSplashTextTone();
|
|
73
|
+
private get fillHoverDirection();
|
|
74
|
+
private get fillHoverTextTone();
|
|
75
|
+
private get fillSplashDirection();
|
|
76
|
+
private get fillSplashTextTone();
|
|
77
|
+
private get textHoverTone();
|
|
78
|
+
private get textSplashTone();
|
|
79
|
+
private get textHoverDirection();
|
|
80
|
+
private get textSplashDirection();
|
|
81
|
+
get background(): Argb;
|
|
82
|
+
get backgroundText(): Argb;
|
|
83
|
+
get backgroundFill(): Argb;
|
|
84
|
+
get backgroundHovered(): Argb;
|
|
85
|
+
get backgroundSplashed(): Argb;
|
|
86
|
+
get backgroundHoveredText(): Argb;
|
|
87
|
+
get backgroundSplashedText(): Argb;
|
|
88
|
+
get backgroundHoveredFill(): Argb;
|
|
89
|
+
get backgroundSplashedFill(): Argb;
|
|
90
|
+
get color(): Argb;
|
|
91
|
+
get colorText(): Argb;
|
|
92
|
+
get colorIcon(): Argb;
|
|
93
|
+
get colorHovered(): Argb;
|
|
94
|
+
get colorSplashed(): Argb;
|
|
95
|
+
get colorHoveredText(): Argb;
|
|
96
|
+
get colorSplashedText(): Argb;
|
|
97
|
+
get colorHoveredIcon(): Argb;
|
|
98
|
+
get colorSplashedIcon(): Argb;
|
|
99
|
+
get fill(): Argb;
|
|
100
|
+
get fillText(): Argb;
|
|
101
|
+
get fillIcon(): Argb;
|
|
102
|
+
get fillHovered(): Argb;
|
|
103
|
+
get fillSplashed(): Argb;
|
|
104
|
+
get fillHoveredText(): Argb;
|
|
105
|
+
get fillSplashedText(): Argb;
|
|
106
|
+
get fillHoveredIcon(): Argb;
|
|
107
|
+
get fillSplashedIcon(): Argb;
|
|
108
|
+
get text(): Argb;
|
|
109
|
+
get textHovered(): Argb;
|
|
110
|
+
get textSplashed(): Argb;
|
|
111
|
+
get textHoveredText(): Argb;
|
|
112
|
+
get textSplashedText(): Argb;
|
|
113
|
+
get backgroundBorder(): Argb;
|
|
114
|
+
get colorBorder(): Argb;
|
|
115
|
+
get fillBorder(): Argb;
|
|
116
|
+
get backgroundHoveredBorder(): Argb;
|
|
117
|
+
get backgroundSplashedBorder(): Argb;
|
|
118
|
+
get colorHoveredBorder(): Argb;
|
|
119
|
+
get colorSplashedBorder(): Argb;
|
|
120
|
+
get fillHoveredBorder(): Argb;
|
|
121
|
+
get fillSplashedBorder(): Argb;
|
|
122
|
+
private solveBorderTone;
|
|
123
|
+
private overlayBorder;
|
|
124
|
+
private candidate;
|
|
125
|
+
private solveEitherSideBorder;
|
|
126
|
+
private twoRefBorderTone;
|
|
127
|
+
toRecord(): Record<PaletteRole, Argb>;
|
|
128
|
+
toHexRecord(): Record<PaletteRole, string>;
|
|
129
|
+
}
|
package/dist/palette.js
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { Hct } from './hct.js';
|
|
2
|
+
import { hexFromArgb } from './color.js';
|
|
3
|
+
import { Algo, Usage, ContrastDirection, clamp, contrastingTone, contrastBetweenArgbs, getAbsoluteContrast, lighterLstarUnsafe, darkerLstarUnsafe, lstarPrefersLighterPair, sharedForegroundDirection } from './contrast.js';
|
|
4
|
+
export const paletteRoles = [
|
|
5
|
+
'background', 'backgroundText', 'backgroundFill', 'backgroundBorder', 'backgroundHovered', 'backgroundSplashed', 'backgroundHoveredFill', 'backgroundSplashedFill', 'backgroundHoveredText', 'backgroundSplashedText', 'backgroundHoveredBorder', 'backgroundSplashedBorder', 'color', 'colorText', 'colorIcon', 'colorHovered', 'colorSplashed', 'colorHoveredText', 'colorSplashedText', 'colorHoveredIcon', 'colorSplashedIcon', 'colorBorder', 'colorHoveredBorder', 'colorSplashedBorder', 'fill', 'fillText', 'fillIcon', 'fillHovered', 'fillSplashed', 'fillHoveredText', 'fillSplashedText', 'fillHoveredIcon', 'fillSplashedIcon', 'fillBorder', 'fillHoveredBorder', 'fillSplashedBorder', 'text', 'textHovered', 'textSplashed', 'textHoveredText', 'textSplashedText'
|
|
6
|
+
];
|
|
7
|
+
export class Palette {
|
|
8
|
+
baseColor;
|
|
9
|
+
baseBackground;
|
|
10
|
+
backgroundToneOverride;
|
|
11
|
+
contrast;
|
|
12
|
+
algo;
|
|
13
|
+
colorModel;
|
|
14
|
+
static from(color, options) {
|
|
15
|
+
const colorModel = options.colorModel ?? 'cam16v11';
|
|
16
|
+
const hct = Hct.fromInt(color, colorModel);
|
|
17
|
+
// Native model units, not a cross-model chroma conversion.
|
|
18
|
+
const neutralChroma = colorModel === 'oklch' ? 0.04 : 16;
|
|
19
|
+
const bg = Hct.from(hct.hue, Math.min(neutralChroma, hct.chroma), options.backgroundTone, colorModel).toInt();
|
|
20
|
+
return new Palette(color, bg, options.backgroundTone, options.contrast ?? 0.5, options.algo ?? Algo.apca, colorModel);
|
|
21
|
+
}
|
|
22
|
+
static fromColorAndBackground(color, background, options = {}) {
|
|
23
|
+
return new Palette(color, background, options.backgroundTone, options.contrast ?? 0.5, options.algo ?? Algo.apca, options.colorModel ?? 'cam16v11');
|
|
24
|
+
}
|
|
25
|
+
colorHct;
|
|
26
|
+
backgroundHct;
|
|
27
|
+
colorHue;
|
|
28
|
+
colorChroma;
|
|
29
|
+
colorTone;
|
|
30
|
+
backgroundHue;
|
|
31
|
+
backgroundChroma;
|
|
32
|
+
backgroundTone;
|
|
33
|
+
cache = new Map();
|
|
34
|
+
constructor(baseColor, baseBackground, backgroundToneOverride, contrast, algo, colorModel) {
|
|
35
|
+
this.baseColor = baseColor;
|
|
36
|
+
this.baseBackground = baseBackground;
|
|
37
|
+
this.backgroundToneOverride = backgroundToneOverride;
|
|
38
|
+
this.contrast = contrast;
|
|
39
|
+
this.algo = algo;
|
|
40
|
+
this.colorModel = colorModel;
|
|
41
|
+
this.colorHct = Hct.fromInt(this.baseColor, this.colorModel);
|
|
42
|
+
this.backgroundHct = Hct.fromInt(this.baseBackground, this.colorModel);
|
|
43
|
+
this.colorHue = this.colorHct.hue;
|
|
44
|
+
this.colorChroma = Math.max(this.colorHct.chroma, this.backgroundHct.chroma);
|
|
45
|
+
this.colorTone = this.colorHct.tone;
|
|
46
|
+
this.backgroundHue = this.backgroundHct.hue;
|
|
47
|
+
this.backgroundChroma = this.backgroundHct.chroma;
|
|
48
|
+
this.backgroundTone = this.backgroundToneOverride ?? this.backgroundHct.tone;
|
|
49
|
+
}
|
|
50
|
+
solve(containerTone, containerArgb, targetHue, targetChroma, usage, dial, direction) {
|
|
51
|
+
return contrastingTone({ withArgb: containerArgb, withTone: containerTone, targetHue, targetChroma, usage, by: this.algo, contrast: dial, colorModel: this.colorModel, forceDirection: direction });
|
|
52
|
+
}
|
|
53
|
+
withColorsChroma(tone) { return Hct.from(this.colorHue, this.colorChroma, tone, this.colorModel).toInt(); }
|
|
54
|
+
withBackgroundsChroma(tone) { return Hct.from(this.backgroundHue, this.backgroundChroma, tone, this.colorModel).toInt(); }
|
|
55
|
+
memo(key, fn) {
|
|
56
|
+
if (!this.cache.has(key))
|
|
57
|
+
this.cache.set(key, fn());
|
|
58
|
+
return this.cache.get(key);
|
|
59
|
+
}
|
|
60
|
+
directionFor(backgroundTone) {
|
|
61
|
+
return sharedForegroundDirection({ backgroundTone, contrast: this.contrast, by: this.algo });
|
|
62
|
+
}
|
|
63
|
+
get bgDirection() { return this.memo('bgDirection', () => this.directionFor(this.backgroundTone)); }
|
|
64
|
+
get bgTextTone() { return this.memo('bgTextTone', () => this.solve(this.backgroundTone, this.baseBackground, this.backgroundHue, this.backgroundChroma, Usage.text, this.contrast, this.bgDirection)); }
|
|
65
|
+
// Share context polarity, not a tone verified for a different foreground RGB.
|
|
66
|
+
get textTone() { return this.memo('textTone', () => this.solve(this.backgroundTone, this.baseBackground, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.bgDirection)); }
|
|
67
|
+
get fillDirection() { return this.memo('fillDirection', () => this.directionFor(this.bgFillTone)); }
|
|
68
|
+
get fillTextTone() { return this.memo('fillTextTone', () => this.solve(this.bgFillTone, this.fill, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.fillDirection)); }
|
|
69
|
+
get colorDirection() { return this.memo('colorDirection', () => this.directionFor(this.colorTone)); }
|
|
70
|
+
get colorTextTone() { return this.memo('colorTextTone', () => this.solve(this.colorTone, this.baseColor, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.colorDirection)); }
|
|
71
|
+
get hoverDial() { return Math.max(this.contrast - 0.3, 0.1); }
|
|
72
|
+
get splashDial() { return Math.max(this.contrast - 0.15, 0.25); }
|
|
73
|
+
get borderContrast() { return getAbsoluteContrast(this.algo, this.contrast, Usage.border); }
|
|
74
|
+
get fgContrast() { return getAbsoluteContrast(this.algo, this.contrast, Usage.fill); }
|
|
75
|
+
get bgFillTone() { return this.memo('bgFillTone', () => this.solve(this.backgroundTone, this.baseBackground, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.bgDirection)); }
|
|
76
|
+
get bgHoverTone() { return this.memo('bgHoverTone', () => this.solve(this.backgroundTone, this.baseBackground, this.colorHue, this.colorChroma, Usage.fill, this.hoverDial, this.bgDirection)); }
|
|
77
|
+
get bgSplashTone() { return this.memo('bgSplashTone', () => this.solve(this.backgroundTone, this.baseBackground, this.colorHue, this.colorChroma, Usage.fill, this.splashDial, this.bgDirection)); }
|
|
78
|
+
get colorHoverTone() { return this.memo('colorHoverTone', () => this.solve(this.colorTone, this.baseColor, this.colorHue, this.colorChroma, Usage.fill, this.hoverDial, this.colorDirection)); }
|
|
79
|
+
get colorSplashTone() { return this.memo('colorSplashTone', () => this.solve(this.colorTone, this.baseColor, this.colorHue, this.colorChroma, Usage.fill, this.splashDial, this.colorDirection)); }
|
|
80
|
+
get fillHoverTone() { return this.memo('fillHoverTone', () => this.solve(this.bgFillTone, this.fill, this.colorHue, this.colorChroma, Usage.fill, this.hoverDial, this.fillDirection)); }
|
|
81
|
+
get fillSplashTone() { return this.memo('fillSplashTone', () => this.solve(this.bgFillTone, this.fill, this.colorHue, this.colorChroma, Usage.fill, this.splashDial, this.fillDirection)); }
|
|
82
|
+
get bgHoverDirection() { return this.memo('bgHoverDirection', () => this.directionFor(this.bgHoverTone)); }
|
|
83
|
+
get bgHoverTextTone() { return this.memo('bgHoverTextTone', () => this.solve(this.bgHoverTone, this.backgroundHovered, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.bgHoverDirection)); }
|
|
84
|
+
get bgSplashDirection() { return this.memo('bgSplashDirection', () => this.directionFor(this.bgSplashTone)); }
|
|
85
|
+
get bgSplashTextTone() { return this.memo('bgSplashTextTone', () => this.solve(this.bgSplashTone, this.backgroundSplashed, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.bgSplashDirection)); }
|
|
86
|
+
get colorHoverDirection() { return this.memo('colorHoverDirection', () => this.directionFor(this.colorHoverTone)); }
|
|
87
|
+
get colorHoverTextTone() { return this.memo('colorHoverTextTone', () => this.solve(this.colorHoverTone, this.colorHovered, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.colorHoverDirection)); }
|
|
88
|
+
get colorSplashDirection() { return this.memo('colorSplashDirection', () => this.directionFor(this.colorSplashTone)); }
|
|
89
|
+
get colorSplashTextTone() { return this.memo('colorSplashTextTone', () => this.solve(this.colorSplashTone, this.colorSplashed, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.colorSplashDirection)); }
|
|
90
|
+
get fillHoverDirection() { return this.memo('fillHoverDirection', () => this.directionFor(this.fillHoverTone)); }
|
|
91
|
+
get fillHoverTextTone() { return this.memo('fillHoverTextTone', () => this.solve(this.fillHoverTone, this.fillHovered, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.fillHoverDirection)); }
|
|
92
|
+
get fillSplashDirection() { return this.memo('fillSplashDirection', () => this.directionFor(this.fillSplashTone)); }
|
|
93
|
+
get fillSplashTextTone() { return this.memo('fillSplashTextTone', () => this.solve(this.fillSplashTone, this.fillSplashed, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.fillSplashDirection)); }
|
|
94
|
+
get textHoverTone() { return this.memo('textHoverTone', () => this.solve(this.backgroundTone, this.baseBackground, this.colorHue, this.colorChroma, Usage.text, this.hoverDial, this.bgDirection)); }
|
|
95
|
+
get textSplashTone() { return this.memo('textSplashTone', () => this.solve(this.backgroundTone, this.baseBackground, this.colorHue, this.colorChroma, Usage.text, this.splashDial, this.bgDirection)); }
|
|
96
|
+
get textHoverDirection() { return this.memo('textHoverDirection', () => this.directionFor(this.textHoverTone)); }
|
|
97
|
+
get textSplashDirection() { return this.memo('textSplashDirection', () => this.directionFor(this.textSplashTone)); }
|
|
98
|
+
get background() { return this.baseBackground; }
|
|
99
|
+
get backgroundText() { return this.withBackgroundsChroma(this.bgTextTone); }
|
|
100
|
+
get backgroundFill() { return this.withBackgroundsChroma(this.bgFillTone); }
|
|
101
|
+
get backgroundHovered() { return this.withColorsChroma(this.bgHoverTone); }
|
|
102
|
+
get backgroundSplashed() { return this.withColorsChroma(this.bgSplashTone); }
|
|
103
|
+
get backgroundHoveredText() { return this.withColorsChroma(this.bgHoverTextTone); }
|
|
104
|
+
get backgroundSplashedText() { return this.withColorsChroma(this.bgSplashTextTone); }
|
|
105
|
+
get backgroundHoveredFill() { return this.withColorsChroma(this.solve(this.bgHoverTone, this.backgroundHovered, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.bgHoverDirection)); }
|
|
106
|
+
get backgroundSplashedFill() { return this.withColorsChroma(this.solve(this.bgSplashTone, this.backgroundSplashed, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.bgSplashDirection)); }
|
|
107
|
+
get color() { return this.baseColor; }
|
|
108
|
+
get colorText() { return this.withColorsChroma(this.colorTextTone); }
|
|
109
|
+
get colorIcon() { return this.withColorsChroma(this.solve(this.colorTone, this.baseColor, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.colorDirection)); }
|
|
110
|
+
get colorHovered() { return this.withColorsChroma(this.colorHoverTone); }
|
|
111
|
+
get colorSplashed() { return this.withColorsChroma(this.colorSplashTone); }
|
|
112
|
+
get colorHoveredText() { return this.withColorsChroma(this.colorHoverTextTone); }
|
|
113
|
+
get colorSplashedText() { return this.withColorsChroma(this.colorSplashTextTone); }
|
|
114
|
+
get colorHoveredIcon() { return this.withColorsChroma(this.solve(this.colorHoverTone, this.colorHovered, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.colorHoverDirection)); }
|
|
115
|
+
get colorSplashedIcon() { return this.withColorsChroma(this.solve(this.colorSplashTone, this.colorSplashed, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.colorSplashDirection)); }
|
|
116
|
+
get fill() { return this.withColorsChroma(this.bgFillTone); }
|
|
117
|
+
get fillText() { return this.withColorsChroma(this.fillTextTone); }
|
|
118
|
+
get fillIcon() { return this.withColorsChroma(this.solve(this.bgFillTone, this.fill, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.fillDirection)); }
|
|
119
|
+
get fillHovered() { return this.withColorsChroma(this.fillHoverTone); }
|
|
120
|
+
get fillSplashed() { return this.withColorsChroma(this.fillSplashTone); }
|
|
121
|
+
get fillHoveredText() { return this.withColorsChroma(this.fillHoverTextTone); }
|
|
122
|
+
get fillSplashedText() { return this.withColorsChroma(this.fillSplashTextTone); }
|
|
123
|
+
get fillHoveredIcon() { return this.withColorsChroma(this.solve(this.fillHoverTone, this.fillHovered, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.fillHoverDirection)); }
|
|
124
|
+
get fillSplashedIcon() { return this.withColorsChroma(this.solve(this.fillSplashTone, this.fillSplashed, this.colorHue, this.colorChroma, Usage.fill, this.contrast, this.fillSplashDirection)); }
|
|
125
|
+
get text() { return this.withColorsChroma(this.textTone); }
|
|
126
|
+
get textHovered() { return this.withColorsChroma(this.textHoverTone); }
|
|
127
|
+
get textSplashed() { return this.withColorsChroma(this.textSplashTone); }
|
|
128
|
+
get textHoveredText() { return this.withColorsChroma(this.solve(this.textHoverTone, this.textHovered, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.textHoverDirection)); }
|
|
129
|
+
get textSplashedText() { return this.withColorsChroma(this.solve(this.textSplashTone, this.textSplashed, this.colorHue, this.colorChroma, Usage.text, this.contrast, this.textSplashDirection)); }
|
|
130
|
+
get backgroundBorder() { return this.withBackgroundsChroma(this.solveBorderTone(this.backgroundTone, this.baseBackground, this.backgroundHue, this.backgroundChroma)); }
|
|
131
|
+
get colorBorder() { return this.solveEitherSideBorder(this.colorTone, this.colorTone, this.backgroundTone, this.colorHue, this.colorChroma); }
|
|
132
|
+
get fillBorder() { return this.solveEitherSideBorder(this.bgFillTone, this.colorTone, this.backgroundTone, this.colorHue, this.colorChroma); }
|
|
133
|
+
get backgroundHoveredBorder() { return this.overlayBorder(this.bgHoverTone); }
|
|
134
|
+
get backgroundSplashedBorder() { return this.overlayBorder(this.bgSplashTone); }
|
|
135
|
+
get colorHoveredBorder() { return this.overlayBorder(this.colorHoverTone); }
|
|
136
|
+
get colorSplashedBorder() { return this.overlayBorder(this.colorSplashTone); }
|
|
137
|
+
get fillHoveredBorder() { return this.overlayBorder(this.fillHoverTone); }
|
|
138
|
+
get fillSplashedBorder() { return this.overlayBorder(this.fillSplashTone); }
|
|
139
|
+
solveBorderTone(containerTone, containerArgb, hue, chroma) {
|
|
140
|
+
const darker = ContrastDirection.darker, lighter = ContrastDirection.lighter;
|
|
141
|
+
const usage = Usage.border;
|
|
142
|
+
const meets = (t) => Math.abs(contrastBetweenArgbs(this.algo, containerArgb, Hct.from(hue, chroma, t, this.colorModel).toInt())) >= this.borderContrast;
|
|
143
|
+
const tones = [this.solve(containerTone, containerArgb, hue, chroma, usage, this.contrast, darker), this.solve(containerTone, containerArgb, hue, chroma, usage, this.contrast, lighter)].filter(meets);
|
|
144
|
+
if (tones.length === 0)
|
|
145
|
+
return this.solve(containerTone, containerArgb, hue, chroma, usage, this.contrast, lighter);
|
|
146
|
+
return (tones.filter(t => t < containerTone)[0] ?? tones[0]);
|
|
147
|
+
}
|
|
148
|
+
overlayBorder(overlayTone) {
|
|
149
|
+
const overlayArgb = this.withColorsChroma(overlayTone);
|
|
150
|
+
const vsOverlay = Math.abs(contrastBetweenArgbs(this.algo, overlayArgb, this.baseColor));
|
|
151
|
+
const vsBg = Math.abs(contrastBetweenArgbs(this.algo, this.baseBackground, this.baseColor));
|
|
152
|
+
if (vsOverlay >= this.borderContrast && vsBg >= this.borderContrast)
|
|
153
|
+
return this.baseColor;
|
|
154
|
+
return this.withColorsChroma(this.twoRefBorderTone(overlayTone, overlayArgb, this.backgroundTone, this.baseBackground, this.colorHue, this.colorChroma));
|
|
155
|
+
}
|
|
156
|
+
candidate(startTone, refArgb, hue, chroma, lighter) {
|
|
157
|
+
if (this.algo === Algo.wcag21) {
|
|
158
|
+
return lighter
|
|
159
|
+
? lighterLstarUnsafe(startTone, this.borderContrast)
|
|
160
|
+
: darkerLstarUnsafe(startTone, this.borderContrast);
|
|
161
|
+
}
|
|
162
|
+
const lcAt = (t) => Math.abs(contrastBetweenArgbs(this.algo, refArgb, Hct.from(hue, chroma, t, this.colorModel).toInt()));
|
|
163
|
+
if (lighter) {
|
|
164
|
+
if (lcAt(100) < this.borderContrast)
|
|
165
|
+
return 101;
|
|
166
|
+
let lo = startTone, hi = 100;
|
|
167
|
+
for (let i = 0; i < 15; i++) {
|
|
168
|
+
const m = (lo + hi) / 2;
|
|
169
|
+
if (lcAt(m) >= this.borderContrast)
|
|
170
|
+
hi = m;
|
|
171
|
+
else
|
|
172
|
+
lo = m;
|
|
173
|
+
}
|
|
174
|
+
return hi;
|
|
175
|
+
}
|
|
176
|
+
if (lcAt(0) < this.borderContrast)
|
|
177
|
+
return -1;
|
|
178
|
+
let lo = 0, hi = startTone;
|
|
179
|
+
for (let i = 0; i < 15; i++) {
|
|
180
|
+
const m = (lo + hi) / 2;
|
|
181
|
+
if (lcAt(m) >= this.borderContrast)
|
|
182
|
+
lo = m;
|
|
183
|
+
else
|
|
184
|
+
hi = m;
|
|
185
|
+
}
|
|
186
|
+
return lo;
|
|
187
|
+
}
|
|
188
|
+
solveEitherSideBorder(innerTone, baseTone, backgroundTone, hue, chroma) {
|
|
189
|
+
const bgArgb = backgroundTone === this.backgroundTone
|
|
190
|
+
? this.baseBackground
|
|
191
|
+
: Hct.from(this.backgroundHue, this.backgroundChroma, backgroundTone, this.colorModel).toInt();
|
|
192
|
+
const innerArgb = innerTone === this.colorTone
|
|
193
|
+
? this.baseColor
|
|
194
|
+
: Hct.from(hue, chroma, innerTone, this.colorModel).toInt();
|
|
195
|
+
const fgVsBg = Math.max(Math.abs(contrastBetweenArgbs(this.algo, bgArgb, innerArgb)), Math.abs(contrastBetweenArgbs(this.algo, innerArgb, bgArgb)));
|
|
196
|
+
if (fgVsBg >= this.fgContrast)
|
|
197
|
+
return Hct.from(hue, chroma, innerTone, this.colorModel).toInt();
|
|
198
|
+
const candidates = [
|
|
199
|
+
this.candidate(backgroundTone, bgArgb, hue, chroma, true), this.candidate(backgroundTone, bgArgb, hue, chroma, false),
|
|
200
|
+
this.candidate(innerTone, innerArgb, hue, chroma, true), this.candidate(innerTone, innerArgb, hue, chroma, false), baseTone,
|
|
201
|
+
].filter(t => t >= 0 && t <= 100).map(t => clamp(t, 0, 100));
|
|
202
|
+
const scored = candidates.map(t => {
|
|
203
|
+
const argb = Hct.from(hue, chroma, t, this.colorModel).toInt();
|
|
204
|
+
const lcBg = Math.abs(contrastBetweenArgbs(this.algo, bgArgb, argb));
|
|
205
|
+
const lcIn = Math.abs(contrastBetweenArgbs(this.algo, innerArgb, argb));
|
|
206
|
+
return { t, argb, lcBg, lcIn };
|
|
207
|
+
});
|
|
208
|
+
const valid = scored.filter(c => c.lcBg >= this.borderContrast || c.lcIn >= this.borderContrast);
|
|
209
|
+
const preferred = valid.filter(c => c.t < innerTone || Math.abs(c.t - innerTone) <= 1);
|
|
210
|
+
const pool = preferred.length ? preferred : valid;
|
|
211
|
+
if (!pool.length) {
|
|
212
|
+
const costFor = (t) => {
|
|
213
|
+
const argb = Hct.from(hue, chroma, t, this.colorModel).toInt();
|
|
214
|
+
const lcBg = Math.abs(contrastBetweenArgbs(this.algo, bgArgb, argb));
|
|
215
|
+
const lcIn = Math.abs(contrastBetweenArgbs(this.algo, innerArgb, argb));
|
|
216
|
+
return Math.max(0, this.borderContrast - Math.max(lcBg, lcIn));
|
|
217
|
+
};
|
|
218
|
+
const costBlack = costFor(0);
|
|
219
|
+
const costWhite = costFor(100);
|
|
220
|
+
const totalDelta = (t) => Math.abs(t - innerTone) + Math.abs(t - backgroundTone);
|
|
221
|
+
const fallbackTone = costBlack < costWhite - 1e-6
|
|
222
|
+
? 0
|
|
223
|
+
: costWhite < costBlack - 1e-6
|
|
224
|
+
? 100
|
|
225
|
+
: totalDelta(0) <= totalDelta(100) ? 0 : 100;
|
|
226
|
+
return Hct.from(hue, chroma, fallbackTone, this.colorModel).toInt();
|
|
227
|
+
}
|
|
228
|
+
pool.sort((a, b) => {
|
|
229
|
+
const bestA = Math.max(a.lcBg, a.lcIn);
|
|
230
|
+
const bestB = Math.max(b.lcBg, b.lcIn);
|
|
231
|
+
const costA = Math.max(0, this.borderContrast - bestA);
|
|
232
|
+
const costB = Math.max(0, this.borderContrast - bestB);
|
|
233
|
+
if (Math.abs(costA - costB) > 1e-6)
|
|
234
|
+
return costA - costB;
|
|
235
|
+
const totalA = Math.abs(a.t - innerTone) + Math.abs(a.t - backgroundTone);
|
|
236
|
+
const totalB = Math.abs(b.t - innerTone) + Math.abs(b.t - backgroundTone);
|
|
237
|
+
if (Math.abs(totalA - totalB) > 1e-6)
|
|
238
|
+
return totalA - totalB;
|
|
239
|
+
const innerA = Math.abs(a.t - innerTone);
|
|
240
|
+
const innerB = Math.abs(b.t - innerTone);
|
|
241
|
+
if (Math.abs(innerA - innerB) > 1e-6)
|
|
242
|
+
return innerA - innerB;
|
|
243
|
+
return Math.abs(a.t - backgroundTone) - Math.abs(b.t - backgroundTone);
|
|
244
|
+
});
|
|
245
|
+
return pool[0].argb;
|
|
246
|
+
}
|
|
247
|
+
twoRefBorderTone(refA, refAArgb, refB, refBArgb, hue, chroma) {
|
|
248
|
+
const delta = (t) => Math.abs(t - refA) + Math.abs(t - refB);
|
|
249
|
+
const candidateSet = new Set();
|
|
250
|
+
for (const t of [
|
|
251
|
+
this.candidate(refA, refAArgb, hue, chroma, true),
|
|
252
|
+
this.candidate(refA, refAArgb, hue, chroma, false),
|
|
253
|
+
this.candidate(refB, refBArgb, hue, chroma, true),
|
|
254
|
+
this.candidate(refB, refBArgb, hue, chroma, false),
|
|
255
|
+
]) {
|
|
256
|
+
if (t >= 0 && t <= 100)
|
|
257
|
+
candidateSet.add(clamp(t, 0, 100));
|
|
258
|
+
}
|
|
259
|
+
const candidates = Array.from(candidateSet);
|
|
260
|
+
const valid = candidates.filter(t => {
|
|
261
|
+
const argb = Hct.from(hue, chroma, t, this.colorModel).toInt();
|
|
262
|
+
return [refAArgb, refBArgb].some(ref => Math.abs(contrastBetweenArgbs(this.algo, ref, argb)) >= this.borderContrast ||
|
|
263
|
+
Math.abs(contrastBetweenArgbs(this.algo, argb, ref)) >= this.borderContrast);
|
|
264
|
+
});
|
|
265
|
+
// No tone can meet the required contrast against either reference. Fall
|
|
266
|
+
// back to the core aesthetic rule (mid/dark surfaces pair with lighter
|
|
267
|
+
// companions) instead of comparing tone distances, which is decided by
|
|
268
|
+
// floating-point dust when refA/refB straddle neutral.
|
|
269
|
+
if (!valid.length)
|
|
270
|
+
return lstarPrefersLighterPair(refA) ? 100 : 0;
|
|
271
|
+
const preferLighter = lstarPrefersLighterPair(refA);
|
|
272
|
+
const directional = valid.filter(t => preferLighter ? t > refA : t < refA);
|
|
273
|
+
const pool = directional.length ? directional : valid;
|
|
274
|
+
pool.sort((a, b) => {
|
|
275
|
+
const diff = delta(a) - delta(b);
|
|
276
|
+
// Match Dart: keep candidate order for equal-distance solutions rather
|
|
277
|
+
// than letting platform floating-point dust choose a different border.
|
|
278
|
+
return Math.abs(diff) <= 1e-6 ? 0 : diff;
|
|
279
|
+
});
|
|
280
|
+
return pool[0];
|
|
281
|
+
}
|
|
282
|
+
toRecord() {
|
|
283
|
+
const out = {};
|
|
284
|
+
for (const role of paletteRoles)
|
|
285
|
+
out[role] = this[role];
|
|
286
|
+
return out;
|
|
287
|
+
}
|
|
288
|
+
toHexRecord() {
|
|
289
|
+
const out = {};
|
|
290
|
+
for (const role of paletteRoles)
|
|
291
|
+
out[role] = hexFromArgb(this[role]);
|
|
292
|
+
return out;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.js","sourceRoot":"","sources":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YACjC,uEAAuE;YACvE,uEAAuE;YACvE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3C,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,CAAC,CAAE,CAAC;IAClB,CAAC;IAED,QAAQ;QACN,MAAM,GAAG,GAAG,EAA+B,CAAC;QAC5C,KAAK,MAAM,IAAI,IAAI,YAAY;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,WAAW;QACT,MAAM,GAAG,GAAG,EAAiC,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,YAAY;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACrE,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Argb } from './color.js';
|
|
2
|
+
import type { PointProvider } from './point-provider.js';
|
|
3
|
+
export declare class PointProviderLab implements PointProvider {
|
|
4
|
+
fromInt(argb: Argb): number[];
|
|
5
|
+
toInt(lab: number[]): Argb;
|
|
6
|
+
distance(one: number[], two: number[]): number;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { argbFromLab, labFromArgb } from './xyz-lab.js';
|
|
2
|
+
export class PointProviderLab {
|
|
3
|
+
fromInt(argb) {
|
|
4
|
+
return labFromArgb(argb);
|
|
5
|
+
}
|
|
6
|
+
toInt(lab) {
|
|
7
|
+
return argbFromLab(lab[0], lab[1], lab[2]);
|
|
8
|
+
}
|
|
9
|
+
distance(one, two) {
|
|
10
|
+
const dL = one[0] - two[0];
|
|
11
|
+
const dA = one[1] - two[1];
|
|
12
|
+
const dB = one[2] - two[2];
|
|
13
|
+
return dL * dL + dA * dA + dB * dB;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=point-provider-lab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-provider-lab.js","sourceRoot":"","sources":["../src/point-provider-lab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,cAAc,CAAC;AAItD,MAAM,OAAO,gBAAgB;IAC3B,OAAO,CAAC,IAAU;QAChB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,GAAa;QACjB,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAE,EAAE,GAAG,CAAC,CAAC,CAAE,EAAE,GAAG,CAAC,CAAC,CAAE,CAAC,CAAC;IAChD,CAAC;IAED,QAAQ,CAAC,GAAa,EAAE,GAAa;QACnC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAE,GAAG,GAAG,CAAC,CAAC,CAAE,CAAC;QAC7B,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAE,GAAG,GAAG,CAAC,CAAC,CAAE,CAAC;QAC7B,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAE,GAAG,GAAG,CAAC,CAAC,CAAE,CAAC;QAC7B,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-provider.js","sourceRoot":"","sources":["../src/point-provider.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Argb } from './color.js';
|
|
2
|
+
import { type QuantizerResult } from './extract.js';
|
|
3
|
+
export interface SerializedQuantizerResultEntries {
|
|
4
|
+
argbToCount: Array<[Argb, number]>;
|
|
5
|
+
inputPixelToClusterPixel?: Array<[Argb, Argb]>;
|
|
6
|
+
lstarToCount?: Array<[number, number]>;
|
|
7
|
+
}
|
|
8
|
+
export interface QuantizeWorkerRequest {
|
|
9
|
+
id: number;
|
|
10
|
+
type: 'libmonet.quantize';
|
|
11
|
+
pixels: Argb[];
|
|
12
|
+
colorCount: number;
|
|
13
|
+
}
|
|
14
|
+
export interface QuantizeWorkerResponse {
|
|
15
|
+
id: number;
|
|
16
|
+
type: 'libmonet.quantize.result';
|
|
17
|
+
result?: SerializedQuantizerResultEntries;
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface WorkerLike {
|
|
21
|
+
postMessage(message: unknown, transfer?: Transferable[]): void;
|
|
22
|
+
addEventListener(type: 'message', listener: (event: MessageEvent<unknown>) => void): void;
|
|
23
|
+
removeEventListener(type: 'message', listener: (event: MessageEvent<unknown>) => void): void;
|
|
24
|
+
terminate?(): void;
|
|
25
|
+
}
|
|
26
|
+
export interface QuantizeWorkerScope {
|
|
27
|
+
postMessage(message: unknown): void;
|
|
28
|
+
addEventListener(type: 'message', listener: (event: MessageEvent<unknown>) => void): void;
|
|
29
|
+
}
|
|
30
|
+
export declare function serializeQuantizerResultEntries(result: QuantizerResult): SerializedQuantizerResultEntries;
|
|
31
|
+
export declare function deserializeQuantizerResultEntries(serialized: SerializedQuantizerResultEntries): QuantizerResult;
|
|
32
|
+
export declare function createQuantizeWorker(): Worker;
|
|
33
|
+
export declare function quantizeArgbPixelsInWorker(pixels: readonly Argb[], colorCount?: number, worker?: WorkerLike, options?: {
|
|
34
|
+
terminateWhenDone?: boolean;
|
|
35
|
+
}): Promise<QuantizerResult>;
|
|
36
|
+
export declare function installQuantizeWorkerHandler(scope?: QuantizeWorkerScope): void;
|