@oxyhq/bloom 0.36.0 → 0.37.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/lib/commonjs/theme/build-theme.js +31 -43
- package/lib/commonjs/theme/build-theme.js.map +1 -1
- package/lib/commonjs/theme/color-engine/cam16.js +161 -0
- package/lib/commonjs/theme/color-engine/cam16.js.map +1 -0
- package/lib/commonjs/theme/color-engine/color-role.js +183 -0
- package/lib/commonjs/theme/color-engine/color-role.js.map +1 -0
- package/lib/commonjs/theme/color-engine/color-roles.js +416 -0
- package/lib/commonjs/theme/color-engine/color-roles.js.map +1 -0
- package/lib/commonjs/theme/color-engine/color-utils.js +157 -0
- package/lib/commonjs/theme/color-engine/color-utils.js.map +1 -0
- package/lib/commonjs/theme/color-engine/contrast-curve.js +32 -0
- package/lib/commonjs/theme/color-engine/contrast-curve.js.map +1 -0
- package/lib/commonjs/theme/color-engine/contrast.js +70 -0
- package/lib/commonjs/theme/color-engine/contrast.js.map +1 -0
- package/lib/commonjs/theme/color-engine/dislike-analyzer.js +26 -0
- package/lib/commonjs/theme/color-engine/dislike-analyzer.js.map +1 -0
- package/lib/commonjs/theme/color-engine/dynamic-scheme.js +70 -0
- package/lib/commonjs/theme/color-engine/dynamic-scheme.js.map +1 -0
- package/lib/commonjs/theme/color-engine/hct-solver.js +236 -0
- package/lib/commonjs/theme/color-engine/hct-solver.js.map +1 -0
- package/lib/commonjs/theme/color-engine/hct.js +67 -0
- package/lib/commonjs/theme/color-engine/hct.js.map +1 -0
- package/lib/commonjs/theme/color-engine/index.js +173 -0
- package/lib/commonjs/theme/color-engine/index.js.map +1 -0
- package/lib/commonjs/theme/color-engine/lab-point-provider.js +32 -0
- package/lib/commonjs/theme/color-engine/lab-point-provider.js.map +1 -0
- package/lib/commonjs/theme/color-engine/math-utils.js +77 -0
- package/lib/commonjs/theme/color-engine/math-utils.js.map +1 -0
- package/lib/commonjs/theme/color-engine/quantizer-map.js +24 -0
- package/lib/commonjs/theme/color-engine/quantizer-map.js.map +1 -0
- package/lib/commonjs/theme/color-engine/quantizer-wu.js +266 -0
- package/lib/commonjs/theme/color-engine/quantizer-wu.js.map +1 -0
- package/lib/commonjs/theme/color-engine/scheme-variants.js +102 -0
- package/lib/commonjs/theme/color-engine/scheme-variants.js.map +1 -0
- package/lib/commonjs/theme/color-engine/score.js +80 -0
- package/lib/commonjs/theme/color-engine/score.js.map +1 -0
- package/lib/commonjs/theme/color-engine/seed-from-image.js +73 -0
- package/lib/commonjs/theme/color-engine/seed-from-image.js.map +1 -0
- package/lib/commonjs/theme/color-engine/tonal-palette.js +95 -0
- package/lib/commonjs/theme/color-engine/tonal-palette.js.map +1 -0
- package/lib/commonjs/theme/color-engine/tone-delta-pair.js +26 -0
- package/lib/commonjs/theme/color-engine/tone-delta-pair.js.map +1 -0
- package/lib/commonjs/theme/color-engine/variant.js +26 -0
- package/lib/commonjs/theme/color-engine/variant.js.map +1 -0
- package/lib/commonjs/theme/color-engine/viewing-conditions.js +61 -0
- package/lib/commonjs/theme/color-engine/viewing-conditions.js.map +1 -0
- package/lib/commonjs/theme/color-presets.js +44 -572
- package/lib/commonjs/theme/color-presets.js.map +1 -1
- package/lib/commonjs/theme/preset-vars.js +64 -47
- package/lib/commonjs/theme/preset-vars.js.map +1 -1
- package/lib/module/theme/build-theme.js +32 -44
- package/lib/module/theme/build-theme.js.map +1 -1
- package/lib/module/theme/color-engine/cam16.js +155 -0
- package/lib/module/theme/color-engine/cam16.js.map +1 -0
- package/lib/module/theme/color-engine/color-role.js +177 -0
- package/lib/module/theme/color-engine/color-role.js.map +1 -0
- package/lib/module/theme/color-engine/color-roles.js +411 -0
- package/lib/module/theme/color-engine/color-roles.js.map +1 -0
- package/lib/module/theme/color-engine/color-utils.js +135 -0
- package/lib/module/theme/color-engine/color-utils.js.map +1 -0
- package/lib/module/theme/color-engine/contrast-curve.js +26 -0
- package/lib/module/theme/color-engine/contrast-curve.js.map +1 -0
- package/lib/module/theme/color-engine/contrast.js +61 -0
- package/lib/module/theme/color-engine/contrast.js.map +1 -0
- package/lib/module/theme/color-engine/dislike-analyzer.js +20 -0
- package/lib/module/theme/color-engine/dislike-analyzer.js.map +1 -0
- package/lib/module/theme/color-engine/dynamic-scheme.js +65 -0
- package/lib/module/theme/color-engine/dynamic-scheme.js.map +1 -0
- package/lib/module/theme/color-engine/hct-solver.js +231 -0
- package/lib/module/theme/color-engine/hct-solver.js.map +1 -0
- package/lib/module/theme/color-engine/hct.js +61 -0
- package/lib/module/theme/color-engine/hct.js.map +1 -0
- package/lib/module/theme/color-engine/index.js +57 -0
- package/lib/module/theme/color-engine/index.js.map +1 -0
- package/lib/module/theme/color-engine/lab-point-provider.js +25 -0
- package/lib/module/theme/color-engine/lab-point-provider.js.map +1 -0
- package/lib/module/theme/color-engine/math-utils.js +65 -0
- package/lib/module/theme/color-engine/math-utils.js.map +1 -0
- package/lib/module/theme/color-engine/quantizer-map.js +20 -0
- package/lib/module/theme/color-engine/quantizer-map.js.map +1 -0
- package/lib/module/theme/color-engine/quantizer-wu.js +261 -0
- package/lib/module/theme/color-engine/quantizer-wu.js.map +1 -0
- package/lib/module/theme/color-engine/scheme-variants.js +93 -0
- package/lib/module/theme/color-engine/scheme-variants.js.map +1 -0
- package/lib/module/theme/color-engine/score.js +75 -0
- package/lib/module/theme/color-engine/score.js.map +1 -0
- package/lib/module/theme/color-engine/seed-from-image.js +67 -0
- package/lib/module/theme/color-engine/seed-from-image.js.map +1 -0
- package/lib/module/theme/color-engine/tonal-palette.js +89 -0
- package/lib/module/theme/color-engine/tonal-palette.js.map +1 -0
- package/lib/module/theme/color-engine/tone-delta-pair.js +21 -0
- package/lib/module/theme/color-engine/tone-delta-pair.js.map +1 -0
- package/lib/module/theme/color-engine/variant.js +22 -0
- package/lib/module/theme/color-engine/variant.js.map +1 -0
- package/lib/module/theme/color-engine/viewing-conditions.js +55 -0
- package/lib/module/theme/color-engine/viewing-conditions.js.map +1 -0
- package/lib/module/theme/color-presets.js +44 -572
- package/lib/module/theme/color-presets.js.map +1 -1
- package/lib/module/theme/preset-vars.js +64 -46
- package/lib/module/theme/preset-vars.js.map +1 -1
- package/lib/typescript/commonjs/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-engine/cam16.d.ts +26 -0
- package/lib/typescript/commonjs/theme/color-engine/cam16.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/color-role.d.ts +36 -0
- package/lib/typescript/commonjs/theme/color-engine/color-role.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/color-roles.d.ts +58 -0
- package/lib/typescript/commonjs/theme/color-engine/color-roles.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/color-utils.d.ts +32 -0
- package/lib/typescript/commonjs/theme/color-engine/color-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/contrast-curve.d.ts +9 -0
- package/lib/typescript/commonjs/theme/color-engine/contrast-curve.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/contrast.d.ts +12 -0
- package/lib/typescript/commonjs/theme/color-engine/contrast.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/dislike-analyzer.d.ts +11 -0
- package/lib/typescript/commonjs/theme/color-engine/dislike-analyzer.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/dynamic-scheme.d.ts +47 -0
- package/lib/typescript/commonjs/theme/color-engine/dynamic-scheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/hct-solver.d.ts +6 -0
- package/lib/typescript/commonjs/theme/color-engine/hct-solver.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/hct.d.ts +20 -0
- package/lib/typescript/commonjs/theme/color-engine/hct.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/index.d.ts +44 -0
- package/lib/typescript/commonjs/theme/color-engine/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/lab-point-provider.d.ts +6 -0
- package/lib/typescript/commonjs/theme/color-engine/lab-point-provider.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/math-utils.d.ts +46 -0
- package/lib/typescript/commonjs/theme/color-engine/math-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/quantizer-map.d.ts +3 -0
- package/lib/typescript/commonjs/theme/color-engine/quantizer-map.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/quantizer-wu.d.ts +3 -0
- package/lib/typescript/commonjs/theme/color-engine/quantizer-wu.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/scheme-variants.d.ts +23 -0
- package/lib/typescript/commonjs/theme/color-engine/scheme-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/score.d.ts +8 -0
- package/lib/typescript/commonjs/theme/color-engine/score.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/seed-from-image.d.ts +13 -0
- package/lib/typescript/commonjs/theme/color-engine/seed-from-image.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/tonal-palette.d.ts +24 -0
- package/lib/typescript/commonjs/theme/color-engine/tonal-palette.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/tone-delta-pair.d.ts +19 -0
- package/lib/typescript/commonjs/theme/color-engine/tone-delta-pair.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/variant.d.ts +19 -0
- package/lib/typescript/commonjs/theme/color-engine/variant.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-engine/viewing-conditions.d.ts +18 -0
- package/lib/typescript/commonjs/theme/color-engine/viewing-conditions.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-presets.d.ts +25 -20
- package/lib/typescript/commonjs/theme/color-presets.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/preset-vars.d.ts +16 -12
- package/lib/typescript/commonjs/theme/preset-vars.d.ts.map +1 -1
- package/lib/typescript/module/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-engine/cam16.d.ts +26 -0
- package/lib/typescript/module/theme/color-engine/cam16.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/color-role.d.ts +36 -0
- package/lib/typescript/module/theme/color-engine/color-role.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/color-roles.d.ts +58 -0
- package/lib/typescript/module/theme/color-engine/color-roles.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/color-utils.d.ts +32 -0
- package/lib/typescript/module/theme/color-engine/color-utils.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/contrast-curve.d.ts +9 -0
- package/lib/typescript/module/theme/color-engine/contrast-curve.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/contrast.d.ts +12 -0
- package/lib/typescript/module/theme/color-engine/contrast.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/dislike-analyzer.d.ts +11 -0
- package/lib/typescript/module/theme/color-engine/dislike-analyzer.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/dynamic-scheme.d.ts +47 -0
- package/lib/typescript/module/theme/color-engine/dynamic-scheme.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/hct-solver.d.ts +6 -0
- package/lib/typescript/module/theme/color-engine/hct-solver.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/hct.d.ts +20 -0
- package/lib/typescript/module/theme/color-engine/hct.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/index.d.ts +44 -0
- package/lib/typescript/module/theme/color-engine/index.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/lab-point-provider.d.ts +6 -0
- package/lib/typescript/module/theme/color-engine/lab-point-provider.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/math-utils.d.ts +46 -0
- package/lib/typescript/module/theme/color-engine/math-utils.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/quantizer-map.d.ts +3 -0
- package/lib/typescript/module/theme/color-engine/quantizer-map.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/quantizer-wu.d.ts +3 -0
- package/lib/typescript/module/theme/color-engine/quantizer-wu.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/scheme-variants.d.ts +23 -0
- package/lib/typescript/module/theme/color-engine/scheme-variants.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/score.d.ts +8 -0
- package/lib/typescript/module/theme/color-engine/score.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/seed-from-image.d.ts +13 -0
- package/lib/typescript/module/theme/color-engine/seed-from-image.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/tonal-palette.d.ts +24 -0
- package/lib/typescript/module/theme/color-engine/tonal-palette.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/tone-delta-pair.d.ts +19 -0
- package/lib/typescript/module/theme/color-engine/tone-delta-pair.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/variant.d.ts +19 -0
- package/lib/typescript/module/theme/color-engine/variant.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-engine/viewing-conditions.d.ts +18 -0
- package/lib/typescript/module/theme/color-engine/viewing-conditions.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-presets.d.ts +25 -20
- package/lib/typescript/module/theme/color-presets.d.ts.map +1 -1
- package/lib/typescript/module/theme/preset-vars.d.ts +16 -12
- package/lib/typescript/module/theme/preset-vars.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/BloomThemeProvider.test.tsx +9 -4
- package/src/__tests__/native-root-vars.test.ts +8 -4
- package/src/__tests__/preset-vars.test.ts +66 -37
- package/src/__tests__/theme.test.ts +20 -12
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +509 -509
- package/src/theme/__tests__/__snapshots__/visual-gallery.test.tsx.snap +613 -613
- package/src/theme/__tests__/color-engine-golden.test.ts +81 -0
- package/src/theme/__tests__/fixtures/color-engine-golden.json +1 -0
- package/src/theme/__tests__/golden-tokens.test.ts +6 -7
- package/src/theme/__tests__/runtime-contract.test.ts +8 -8
- package/src/theme/__tests__/theme-colors-parity.test.ts +44 -88
- package/src/theme/build-theme.ts +32 -44
- package/src/theme/color-engine/cam16.ts +179 -0
- package/src/theme/color-engine/color-role.ts +217 -0
- package/src/theme/color-engine/color-roles.ts +435 -0
- package/src/theme/color-engine/color-utils.ts +157 -0
- package/src/theme/color-engine/contrast-curve.ts +25 -0
- package/src/theme/color-engine/contrast.ts +59 -0
- package/src/theme/color-engine/dislike-analyzer.ts +19 -0
- package/src/theme/color-engine/dynamic-scheme.ts +90 -0
- package/src/theme/color-engine/hct-solver.ts +263 -0
- package/src/theme/color-engine/hct.ts +69 -0
- package/src/theme/color-engine/index.ts +73 -0
- package/src/theme/color-engine/lab-point-provider.ts +26 -0
- package/src/theme/color-engine/math-utils.ts +69 -0
- package/src/theme/color-engine/quantizer-map.ts +17 -0
- package/src/theme/color-engine/quantizer-wu.ts +320 -0
- package/src/theme/color-engine/scheme-variants.ts +113 -0
- package/src/theme/color-engine/score.ts +82 -0
- package/src/theme/color-engine/seed-from-image.ts +64 -0
- package/src/theme/color-engine/tonal-palette.ts +94 -0
- package/src/theme/color-engine/tone-delta-pair.ts +21 -0
- package/src/theme/color-engine/variant.ts +18 -0
- package/src/theme/color-engine/viewing-conditions.ts +77 -0
- package/src/theme/color-presets.ts +54 -631
- package/src/theme/preset-vars.ts +65 -49
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ColorRole", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _colorRole.ColorRole;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "DynamicScheme", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _dynamicScheme.DynamicScheme;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "Hct", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _hct.Hct;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "Roles", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _colorRoles.Roles;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "TonalPalette", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _tonalPalette.TonalPalette;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
exports.argbFromHex = argbFromHex;
|
|
37
|
+
Object.defineProperty(exports, "argbFromRgb", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _colorUtils.argbFromRgb;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "blueFromArgb", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _colorUtils.blueFromArgb;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "buildScheme", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () {
|
|
52
|
+
return _schemeVariants.buildScheme;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
exports.generateRoleColors = generateRoleColors;
|
|
56
|
+
Object.defineProperty(exports, "greenFromArgb", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return _colorUtils.greenFromArgb;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
exports.hexFromArgb = hexFromArgb;
|
|
63
|
+
Object.defineProperty(exports, "quantizeImage", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () {
|
|
66
|
+
return _seedFromImage.quantizeImage;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "quantizeWu", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () {
|
|
72
|
+
return _quantizerWu.quantizeWu;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(exports, "redFromArgb", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return _colorUtils.redFromArgb;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "schemeExpressive", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () {
|
|
84
|
+
return _schemeVariants.schemeExpressive;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(exports, "schemeNeutral", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _schemeVariants.schemeNeutral;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "schemeTonalSpot", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () {
|
|
96
|
+
return _schemeVariants.schemeTonalSpot;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(exports, "schemeVibrant", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: function () {
|
|
102
|
+
return _schemeVariants.schemeVibrant;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "score", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () {
|
|
108
|
+
return _score.score;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(exports, "seedHexFromImagePixels", {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function () {
|
|
114
|
+
return _seedFromImage.seedHexFromImagePixels;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, "seedsFromImagePixels", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function () {
|
|
120
|
+
return _seedFromImage.seedsFromImagePixels;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
var _hct = require("./hct.js");
|
|
124
|
+
var _tonalPalette = require("./tonal-palette.js");
|
|
125
|
+
var _dynamicScheme = require("./dynamic-scheme.js");
|
|
126
|
+
var _schemeVariants = require("./scheme-variants.js");
|
|
127
|
+
var _colorRoles = require("./color-roles.js");
|
|
128
|
+
var _colorRole = require("./color-role.js");
|
|
129
|
+
var _quantizerWu = require("./quantizer-wu.js");
|
|
130
|
+
var _score = require("./score.js");
|
|
131
|
+
var _seedFromImage = require("./seed-from-image.js");
|
|
132
|
+
var _colorUtils = require("./color-utils.js");
|
|
133
|
+
/**
|
|
134
|
+
* Bloom colour engine — public surface.
|
|
135
|
+
*
|
|
136
|
+
* A dependency-free tonal colour system (HCT + tonal palettes + dynamic roles)
|
|
137
|
+
* reimplemented in Bloom from the Material Color Utilities algorithm (Apache-2.0)
|
|
138
|
+
* and verified byte-for-byte against it. Give it ANY seed colour and it derives a
|
|
139
|
+
* full, self-consistent, WCAG-legible set of roles for light and dark at any
|
|
140
|
+
* contrast level — the same dynamic theming MaterialKolor does, but ours.
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
/** Parse a `#rrggbb` (or `#aarrggbb`) hex string into an ARGB int. */
|
|
144
|
+
function argbFromHex(hex) {
|
|
145
|
+
const h = hex.replace('#', '');
|
|
146
|
+
const v = h.length === 6 ? `ff${h}` : h;
|
|
147
|
+
return parseInt(v, 16) >>> 0;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Format an ARGB int as `#rrggbb`. */
|
|
151
|
+
function hexFromArgb(argb) {
|
|
152
|
+
const r = (0, _colorUtils.redFromArgb)(argb).toString(16).padStart(2, '0');
|
|
153
|
+
const g = (0, _colorUtils.greenFromArgb)(argb).toString(16).padStart(2, '0');
|
|
154
|
+
const b = (0, _colorUtils.blueFromArgb)(argb).toString(16).padStart(2, '0');
|
|
155
|
+
return `#${r}${g}${b}`;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Every colour role as a modern `rgb(r g b)` string. */
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Generate the full role set from ANY seed colour — the dynamic-theming entry
|
|
162
|
+
* point. Presets are just fixed seeds; a user-picked colour works identically.
|
|
163
|
+
*/
|
|
164
|
+
function generateRoleColors(opts) {
|
|
165
|
+
const scheme = (0, _schemeVariants.buildScheme)(opts.variant ?? 'vibrant', _hct.Hct.fromInt(argbFromHex(opts.seed)), opts.isDark ?? false, opts.contrastLevel ?? 0);
|
|
166
|
+
const out = {};
|
|
167
|
+
for (const name of Object.keys(_colorRoles.Roles)) {
|
|
168
|
+
const argb = _colorRoles.Roles[name].getArgb(scheme);
|
|
169
|
+
out[name] = `rgb(${(0, _colorUtils.redFromArgb)(argb)} ${(0, _colorUtils.greenFromArgb)(argb)} ${(0, _colorUtils.blueFromArgb)(argb)})`;
|
|
170
|
+
}
|
|
171
|
+
return out;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hct","require","_tonalPalette","_dynamicScheme","_schemeVariants","_colorRoles","_colorRole","_quantizerWu","_score","_seedFromImage","_colorUtils","argbFromHex","hex","h","replace","v","length","parseInt","hexFromArgb","argb","r","redFromArgb","toString","padStart","g","greenFromArgb","b","blueFromArgb","generateRoleColors","opts","scheme","buildScheme","variant","Hct","fromInt","seed","isDark","contrastLevel","out","name","Object","keys","Roles","getArgb"],"sourceRoot":"../../../../src","sources":["theme/color-engine/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,cAAA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AG,CAACC,OAAO,CAACvB,WAAW,CAACkB,IAAI,CAACM,IAAI,CAAC,CAAC,EACnCN,IAAI,CAACO,MAAM,IAAI,KAAK,EACpBP,IAAI,CAACQ,aAAa,IAAI,CACxB,CAAC;EACD,MAAMC,GAAG,GAAG,CAAC,CAAe;EAC5B,KAAK,MAAMC,IAAI,IAAIC,MAAM,CAACC,IAAI,CAACC,iBAAK,CAAC,EAAgB;IACnD,MAAMvB,IAAI,GAAGuB,iBAAK,CAACH,IAAI,CAAC,CAACI,OAAO,CAACb,MAAM,CAAC;IACxCQ,GAAG,CAACC,IAAI,CAAC,GAAG,OAAO,IAAAlB,uBAAW,EAACF,IAAI,CAAC,IAAI,IAAAM,yBAAa,EAACN,IAAI,CAAC,IAAI,IAAAQ,wBAAY,EAACR,IAAI,CAAC,GAAG;EACtF;EACA,OAAOmB,GAAG;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.intFromLab = intFromLab;
|
|
7
|
+
exports.labDistance = labDistance;
|
|
8
|
+
exports.labFromInt = labFromInt;
|
|
9
|
+
var _colorUtils = require("./color-utils.js");
|
|
10
|
+
/**
|
|
11
|
+
* Bloom colour engine — L*a*b* point provider.
|
|
12
|
+
*
|
|
13
|
+
* Faithful port of Material Color Utilities' `LabPointProvider` (Apache-2.0).
|
|
14
|
+
* Quantization clusters colours in L*a*b* (perceptually even), so pixels map to
|
|
15
|
+
* points and back through here, with squared-distance as the metric.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
function labFromInt(argb) {
|
|
19
|
+
return (0, _colorUtils.labFromArgb)(argb);
|
|
20
|
+
}
|
|
21
|
+
function intFromLab(point) {
|
|
22
|
+
return (0, _colorUtils.argbFromLab)(point[0], point[1], point[2]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Squared Euclidean distance in L*a*b* (cheaper than the real distance). */
|
|
26
|
+
function labDistance(from, to) {
|
|
27
|
+
const dL = from[0] - to[0];
|
|
28
|
+
const dA = from[1] - to[1];
|
|
29
|
+
const dB = from[2] - to[2];
|
|
30
|
+
return dL * dL + dA * dA + dB * dB;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=lab-point-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_colorUtils","require","labFromInt","argb","labFromArgb","intFromLab","point","argbFromLab","labDistance","from","to","dL","dA","dB"],"sourceRoot":"../../../../src","sources":["theme/color-engine/lab-point-provider.ts"],"mappings":";;;;;;;;AAOA,IAAAA,WAAA,GAAAC,OAAA;AAPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,SAASC,UAAUA,CAACC,IAAY,EAAY;EACjD,OAAO,IAAAC,uBAAW,EAACD,IAAI,CAAC;AAC1B;AAEO,SAASE,UAAUA,CAACC,KAAe,EAAU;EAClD,OAAO,IAAAC,uBAAW,EAACD,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,EAAEA,KAAK,CAAC,CAAC,CAAC,CAAC;AAClD;;AAEA;AACO,SAASE,WAAWA,CAACC,IAAc,EAAEC,EAAY,EAAU;EAChE,MAAMC,EAAE,GAAGF,IAAI,CAAC,CAAC,CAAC,GAAGC,EAAE,CAAC,CAAC,CAAC;EAC1B,MAAME,EAAE,GAAGH,IAAI,CAAC,CAAC,CAAC,GAAGC,EAAE,CAAC,CAAC,CAAC;EAC1B,MAAMG,EAAE,GAAGJ,IAAI,CAAC,CAAC,CAAC,GAAGC,EAAE,CAAC,CAAC,CAAC;EAC1B,OAAOC,EAAE,GAAGA,EAAE,GAAGC,EAAE,GAAGA,EAAE,GAAGC,EAAE,GAAGA,EAAE;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clampDouble = clampDouble;
|
|
7
|
+
exports.clampInt = clampInt;
|
|
8
|
+
exports.differenceDegrees = differenceDegrees;
|
|
9
|
+
exports.lerp = lerp;
|
|
10
|
+
exports.matrixMultiply = matrixMultiply;
|
|
11
|
+
exports.rotationDirection = rotationDirection;
|
|
12
|
+
exports.sanitizeDegreesDouble = sanitizeDegreesDouble;
|
|
13
|
+
exports.sanitizeDegreesInt = sanitizeDegreesInt;
|
|
14
|
+
exports.signum = signum;
|
|
15
|
+
/**
|
|
16
|
+
* Bloom colour engine — scalar/vector maths.
|
|
17
|
+
*
|
|
18
|
+
* Self-contained port of the Material Color Utilities maths helpers (the same
|
|
19
|
+
* primitives MaterialKolor uses), reimplemented in Bloom's own TypeScript so the
|
|
20
|
+
* theme has ZERO external colour dependencies. Algorithm © Google, Apache-2.0;
|
|
21
|
+
* this is a faithful derivative kept byte-compatible via golden tests.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/** 1 if `n > 0`, -1 if `n < 0`, 0 if `n === 0`. */
|
|
25
|
+
function signum(n) {
|
|
26
|
+
return n < 0 ? -1 : n === 0 ? 0 : 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Linear interpolation: `start` at `amount = 0`, `stop` at `amount = 1`. */
|
|
30
|
+
function lerp(start, stop, amount) {
|
|
31
|
+
return (1.0 - amount) * start + amount * stop;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Clamp `input` into `[min, max]`. */
|
|
35
|
+
function clampInt(min, max, input) {
|
|
36
|
+
return input < min ? min : input > max ? max : input;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Clamp `input` into `[min, max]` (floating point). */
|
|
40
|
+
function clampDouble(min, max, input) {
|
|
41
|
+
return input < min ? min : input > max ? max : input;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Wrap a degree measure into `[0, 360)` as an integer. */
|
|
45
|
+
function sanitizeDegreesInt(degrees) {
|
|
46
|
+
degrees = degrees % 360;
|
|
47
|
+
return degrees < 0 ? degrees + 360 : degrees;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Wrap a degree measure into `[0, 360)` as a float. */
|
|
51
|
+
function sanitizeDegreesDouble(degrees) {
|
|
52
|
+
degrees = degrees % 360.0;
|
|
53
|
+
return degrees < 0 ? degrees + 360.0 : degrees;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Sign of the shortest rotation from `from` to `to` on a circle.
|
|
58
|
+
* @returns 1 if increasing `from` is shortest, -1 if decreasing is.
|
|
59
|
+
*/
|
|
60
|
+
function rotationDirection(from, to) {
|
|
61
|
+
const increasingDifference = sanitizeDegreesDouble(to - from);
|
|
62
|
+
return increasingDifference <= 180.0 ? 1.0 : -1.0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Shortest angular distance (degrees) between two hues. */
|
|
66
|
+
function differenceDegrees(a, b) {
|
|
67
|
+
return 180.0 - Math.abs(Math.abs(a - b) - 180.0);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Multiply a 1×3 row vector by a 3×3 matrix. */
|
|
71
|
+
function matrixMultiply(row, matrix) {
|
|
72
|
+
const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];
|
|
73
|
+
const b = row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];
|
|
74
|
+
const c = row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];
|
|
75
|
+
return [a, b, c];
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=math-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["signum","n","lerp","start","stop","amount","clampInt","min","max","input","clampDouble","sanitizeDegreesInt","degrees","sanitizeDegreesDouble","rotationDirection","from","to","increasingDifference","differenceDegrees","a","b","Math","abs","matrixMultiply","row","matrix","c"],"sourceRoot":"../../../../src","sources":["theme/color-engine/math-utils.ts"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,SAASA,MAAMA,CAACC,CAAS,EAAU;EACxC,OAAOA,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAGA,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;AACrC;;AAEA;AACO,SAASC,IAAIA,CAACC,KAAa,EAAEC,IAAY,EAAEC,MAAc,EAAU;EACxE,OAAO,CAAC,GAAG,GAAGA,MAAM,IAAIF,KAAK,GAAGE,MAAM,GAAGD,IAAI;AAC/C;;AAEA;AACO,SAASE,QAAQA,CAACC,GAAW,EAAEC,GAAW,EAAEC,KAAa,EAAU;EACxE,OAAOA,KAAK,GAAGF,GAAG,GAAGA,GAAG,GAAGE,KAAK,GAAGD,GAAG,GAAGA,GAAG,GAAGC,KAAK;AACtD;;AAEA;AACO,SAASC,WAAWA,CAACH,GAAW,EAAEC,GAAW,EAAEC,KAAa,EAAU;EAC3E,OAAOA,KAAK,GAAGF,GAAG,GAAGA,GAAG,GAAGE,KAAK,GAAGD,GAAG,GAAGA,GAAG,GAAGC,KAAK;AACtD;;AAEA;AACO,SAASE,kBAAkBA,CAACC,OAAe,EAAU;EAC1DA,OAAO,GAAGA,OAAO,GAAG,GAAG;EACvB,OAAOA,OAAO,GAAG,CAAC,GAAGA,OAAO,GAAG,GAAG,GAAGA,OAAO;AAC9C;;AAEA;AACO,SAASC,qBAAqBA,CAACD,OAAe,EAAU;EAC7DA,OAAO,GAAGA,OAAO,GAAG,KAAK;EACzB,OAAOA,OAAO,GAAG,CAAC,GAAGA,OAAO,GAAG,KAAK,GAAGA,OAAO;AAChD;;AAEA;AACA;AACA;AACA;AACO,SAASE,iBAAiBA,CAACC,IAAY,EAAEC,EAAU,EAAU;EAClE,MAAMC,oBAAoB,GAAGJ,qBAAqB,CA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|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.countByColor = countByColor;
|
|
7
|
+
var _colorUtils = require("./color-utils.js");
|
|
8
|
+
/**
|
|
9
|
+
* Bloom colour engine — exact colour histogram.
|
|
10
|
+
*
|
|
11
|
+
* Faithful port of Material Color Utilities' `QuantizerMap` (Apache-2.0). Counts
|
|
12
|
+
* how many opaque pixels are each exact colour — the input to Wu quantization.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Count opaque pixels by exact ARGB. Fully-transparent pixels are dropped. */
|
|
16
|
+
function countByColor(pixels) {
|
|
17
|
+
const counts = new Map();
|
|
18
|
+
for (const pixel of pixels) {
|
|
19
|
+
if ((0, _colorUtils.alphaFromArgb)(pixel) < 255) continue;
|
|
20
|
+
counts.set(pixel, (counts.get(pixel) ?? 0) + 1);
|
|
21
|
+
}
|
|
22
|
+
return counts;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=quantizer-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_colorUtils","require","countByColor","pixels","counts","Map","pixel","alphaFromArgb","set","get"],"sourceRoot":"../../../../src","sources":["theme/color-engine/quantizer-map.ts"],"mappings":";;;;;;AAMA,IAAAA,WAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACO,SAASC,YAAYA,CAACC,MAAgB,EAAuB;EAClE,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAiB,CAAC;EACxC,KAAK,MAAMC,KAAK,IAAIH,MAAM,EAAE;IAC1B,IAAI,IAAAI,yBAAa,EAACD,KAAK,CAAC,GAAG,GAAG,EAAE;IAChCF,MAAM,CAACI,GAAG,CAACF,KAAK,EAAE,CAACF,MAAM,CAACK,GAAG,CAACH,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;EACjD;EACA,OAAOF,MAAM;AACf","ignoreList":[]}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.quantizeWu = quantizeWu;
|
|
7
|
+
var _colorUtils = require("./color-utils.js");
|
|
8
|
+
var _quantizerMap = require("./quantizer-map.js");
|
|
9
|
+
/**
|
|
10
|
+
* Bloom colour engine — Wu colour quantizer.
|
|
11
|
+
*
|
|
12
|
+
* Faithful port of Material Color Utilities' `QuantizerWu` (Apache-2.0). Builds a
|
|
13
|
+
* 3-D histogram of the image in a 32³ RGB grid, computes cumulative moments, then
|
|
14
|
+
* greedily splits the colour cube along the axis of greatest variance until it
|
|
15
|
+
* has `maxColors` boxes — each box's mean colour is a representative. Fully
|
|
16
|
+
* DETERMINISTIC (no k-means/randomness), which is why Bloom uses it directly.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const INDEX_BITS = 5;
|
|
20
|
+
const SIDE_LENGTH = 33; // (1 << INDEX_BITS) + 1
|
|
21
|
+
const TOTAL_SIZE = 35937; // SIDE_LENGTH³
|
|
22
|
+
|
|
23
|
+
const makeBox = () => ({
|
|
24
|
+
r0: 0,
|
|
25
|
+
r1: 0,
|
|
26
|
+
g0: 0,
|
|
27
|
+
g1: 0,
|
|
28
|
+
b0: 0,
|
|
29
|
+
b1: 0,
|
|
30
|
+
vol: 0
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Read a moment/weight cell. Every index here is produced by `getIndex` (or a
|
|
35
|
+
* bounded loop) and is always in range for the fixed-size grids, but under
|
|
36
|
+
* `noUncheckedIndexedAccess` the element type is `number | undefined`; this
|
|
37
|
+
* asserts the in-range invariant honestly instead of masking it.
|
|
38
|
+
*/
|
|
39
|
+
function cell(grid, index) {
|
|
40
|
+
const value = grid[index];
|
|
41
|
+
if (value === undefined) throw new RangeError(`quantizer grid index ${index} out of range`);
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Read a colour box by index (the box array is fully pre-populated). */
|
|
46
|
+
function boxAt(cubes, index) {
|
|
47
|
+
const box = cubes[index];
|
|
48
|
+
if (box === undefined) throw new RangeError(`quantizer box index ${index} out of range`);
|
|
49
|
+
return box;
|
|
50
|
+
}
|
|
51
|
+
function getIndex(r, g, b) {
|
|
52
|
+
return (r << INDEX_BITS * 2) + (r << INDEX_BITS + 1) + r + (g << INDEX_BITS) + g + b;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Wu-quantize `pixels` into at most `maxColors` representative ARGB colours. */
|
|
56
|
+
function quantizeWu(pixels, maxColors) {
|
|
57
|
+
const weights = new Array(TOTAL_SIZE).fill(0);
|
|
58
|
+
const momentsR = new Array(TOTAL_SIZE).fill(0);
|
|
59
|
+
const momentsG = new Array(TOTAL_SIZE).fill(0);
|
|
60
|
+
const momentsB = new Array(TOTAL_SIZE).fill(0);
|
|
61
|
+
const moments = new Array(TOTAL_SIZE).fill(0);
|
|
62
|
+
|
|
63
|
+
// Histogram.
|
|
64
|
+
const counts = (0, _quantizerMap.countByColor)(pixels);
|
|
65
|
+
const bitsToRemove = 8 - INDEX_BITS;
|
|
66
|
+
for (const [pixel, count] of counts.entries()) {
|
|
67
|
+
const red = (0, _colorUtils.redFromArgb)(pixel);
|
|
68
|
+
const green = (0, _colorUtils.greenFromArgb)(pixel);
|
|
69
|
+
const blue = (0, _colorUtils.blueFromArgb)(pixel);
|
|
70
|
+
const index = getIndex((red >> bitsToRemove) + 1, (green >> bitsToRemove) + 1, (blue >> bitsToRemove) + 1);
|
|
71
|
+
weights[index] = cell(weights, index) + count;
|
|
72
|
+
momentsR[index] = cell(momentsR, index) + count * red;
|
|
73
|
+
momentsG[index] = cell(momentsG, index) + count * green;
|
|
74
|
+
momentsB[index] = cell(momentsB, index) + count * blue;
|
|
75
|
+
moments[index] = cell(moments, index) + count * (red * red + green * green + blue * blue);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Cumulative moments.
|
|
79
|
+
for (let r = 1; r < SIDE_LENGTH; r++) {
|
|
80
|
+
const area = new Array(SIDE_LENGTH).fill(0);
|
|
81
|
+
const areaR = new Array(SIDE_LENGTH).fill(0);
|
|
82
|
+
const areaG = new Array(SIDE_LENGTH).fill(0);
|
|
83
|
+
const areaB = new Array(SIDE_LENGTH).fill(0);
|
|
84
|
+
const area2 = new Array(SIDE_LENGTH).fill(0.0);
|
|
85
|
+
for (let g = 1; g < SIDE_LENGTH; g++) {
|
|
86
|
+
let line = 0;
|
|
87
|
+
let lineR = 0;
|
|
88
|
+
let lineG = 0;
|
|
89
|
+
let lineB = 0;
|
|
90
|
+
let line2 = 0.0;
|
|
91
|
+
for (let b = 1; b < SIDE_LENGTH; b++) {
|
|
92
|
+
const index = getIndex(r, g, b);
|
|
93
|
+
line += cell(weights, index);
|
|
94
|
+
lineR += cell(momentsR, index);
|
|
95
|
+
lineG += cell(momentsG, index);
|
|
96
|
+
lineB += cell(momentsB, index);
|
|
97
|
+
line2 += cell(moments, index);
|
|
98
|
+
area[b] = cell(area, b) + line;
|
|
99
|
+
areaR[b] = cell(areaR, b) + lineR;
|
|
100
|
+
areaG[b] = cell(areaG, b) + lineG;
|
|
101
|
+
areaB[b] = cell(areaB, b) + lineB;
|
|
102
|
+
area2[b] = cell(area2, b) + line2;
|
|
103
|
+
const prev = getIndex(r - 1, g, b);
|
|
104
|
+
weights[index] = cell(weights, prev) + cell(area, b);
|
|
105
|
+
momentsR[index] = cell(momentsR, prev) + cell(areaR, b);
|
|
106
|
+
momentsG[index] = cell(momentsG, prev) + cell(areaG, b);
|
|
107
|
+
momentsB[index] = cell(momentsB, prev) + cell(areaB, b);
|
|
108
|
+
moments[index] = cell(moments, prev) + cell(area2, b);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const volume = (cube, moment) => cell(moment, getIndex(cube.r1, cube.g1, cube.b1)) - cell(moment, getIndex(cube.r1, cube.g1, cube.b0)) - cell(moment, getIndex(cube.r1, cube.g0, cube.b1)) + cell(moment, getIndex(cube.r1, cube.g0, cube.b0)) - cell(moment, getIndex(cube.r0, cube.g1, cube.b1)) + cell(moment, getIndex(cube.r0, cube.g1, cube.b0)) + cell(moment, getIndex(cube.r0, cube.g0, cube.b1)) - cell(moment, getIndex(cube.r0, cube.g0, cube.b0));
|
|
113
|
+
const bottom = (cube, direction, moment) => {
|
|
114
|
+
switch (direction) {
|
|
115
|
+
case 'red':
|
|
116
|
+
return -cell(moment, getIndex(cube.r0, cube.g1, cube.b1)) + cell(moment, getIndex(cube.r0, cube.g1, cube.b0)) + cell(moment, getIndex(cube.r0, cube.g0, cube.b1)) - cell(moment, getIndex(cube.r0, cube.g0, cube.b0));
|
|
117
|
+
case 'green':
|
|
118
|
+
return -cell(moment, getIndex(cube.r1, cube.g0, cube.b1)) + cell(moment, getIndex(cube.r1, cube.g0, cube.b0)) + cell(moment, getIndex(cube.r0, cube.g0, cube.b1)) - cell(moment, getIndex(cube.r0, cube.g0, cube.b0));
|
|
119
|
+
case 'blue':
|
|
120
|
+
return -cell(moment, getIndex(cube.r1, cube.g1, cube.b0)) + cell(moment, getIndex(cube.r1, cube.g0, cube.b0)) + cell(moment, getIndex(cube.r0, cube.g1, cube.b0)) - cell(moment, getIndex(cube.r0, cube.g0, cube.b0));
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const top = (cube, direction, position, moment) => {
|
|
124
|
+
switch (direction) {
|
|
125
|
+
case 'red':
|
|
126
|
+
return cell(moment, getIndex(position, cube.g1, cube.b1)) - cell(moment, getIndex(position, cube.g1, cube.b0)) - cell(moment, getIndex(position, cube.g0, cube.b1)) + cell(moment, getIndex(position, cube.g0, cube.b0));
|
|
127
|
+
case 'green':
|
|
128
|
+
return cell(moment, getIndex(cube.r1, position, cube.b1)) - cell(moment, getIndex(cube.r1, position, cube.b0)) - cell(moment, getIndex(cube.r0, position, cube.b1)) + cell(moment, getIndex(cube.r0, position, cube.b0));
|
|
129
|
+
case 'blue':
|
|
130
|
+
return cell(moment, getIndex(cube.r1, cube.g1, position)) - cell(moment, getIndex(cube.r1, cube.g0, position)) - cell(moment, getIndex(cube.r0, cube.g1, position)) + cell(moment, getIndex(cube.r0, cube.g0, position));
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const variance = cube => {
|
|
134
|
+
const dr = volume(cube, momentsR);
|
|
135
|
+
const dg = volume(cube, momentsG);
|
|
136
|
+
const db = volume(cube, momentsB);
|
|
137
|
+
const xx = cell(moments, getIndex(cube.r1, cube.g1, cube.b1)) - cell(moments, getIndex(cube.r1, cube.g1, cube.b0)) - cell(moments, getIndex(cube.r1, cube.g0, cube.b1)) + cell(moments, getIndex(cube.r1, cube.g0, cube.b0)) - cell(moments, getIndex(cube.r0, cube.g1, cube.b1)) + cell(moments, getIndex(cube.r0, cube.g1, cube.b0)) + cell(moments, getIndex(cube.r0, cube.g0, cube.b1)) - cell(moments, getIndex(cube.r0, cube.g0, cube.b0));
|
|
138
|
+
const hypotenuse = dr * dr + dg * dg + db * db;
|
|
139
|
+
return xx - hypotenuse / volume(cube, weights);
|
|
140
|
+
};
|
|
141
|
+
const maximize = (cube, direction, first, last, wholeR, wholeG, wholeB, wholeW) => {
|
|
142
|
+
const bottomR = bottom(cube, direction, momentsR);
|
|
143
|
+
const bottomG = bottom(cube, direction, momentsG);
|
|
144
|
+
const bottomB = bottom(cube, direction, momentsB);
|
|
145
|
+
const bottomW = bottom(cube, direction, weights);
|
|
146
|
+
let max = 0.0;
|
|
147
|
+
let cut = -1;
|
|
148
|
+
for (let i = first; i < last; i++) {
|
|
149
|
+
let halfR = bottomR + top(cube, direction, i, momentsR);
|
|
150
|
+
let halfG = bottomG + top(cube, direction, i, momentsG);
|
|
151
|
+
let halfB = bottomB + top(cube, direction, i, momentsB);
|
|
152
|
+
let halfW = bottomW + top(cube, direction, i, weights);
|
|
153
|
+
if (halfW === 0) continue;
|
|
154
|
+
let temp = (halfR * halfR + halfG * halfG + halfB * halfB) / halfW;
|
|
155
|
+
halfR = wholeR - halfR;
|
|
156
|
+
halfG = wholeG - halfG;
|
|
157
|
+
halfB = wholeB - halfB;
|
|
158
|
+
halfW = wholeW - halfW;
|
|
159
|
+
if (halfW === 0) continue;
|
|
160
|
+
temp += (halfR * halfR + halfG * halfG + halfB * halfB) / halfW;
|
|
161
|
+
if (temp > max) {
|
|
162
|
+
max = temp;
|
|
163
|
+
cut = i;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
cutLocation: cut,
|
|
168
|
+
maximum: max
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
const cut = (one, two) => {
|
|
172
|
+
const wholeR = volume(one, momentsR);
|
|
173
|
+
const wholeG = volume(one, momentsG);
|
|
174
|
+
const wholeB = volume(one, momentsB);
|
|
175
|
+
const wholeW = volume(one, weights);
|
|
176
|
+
const maxR = maximize(one, 'red', one.r0 + 1, one.r1, wholeR, wholeG, wholeB, wholeW);
|
|
177
|
+
const maxG = maximize(one, 'green', one.g0 + 1, one.g1, wholeR, wholeG, wholeB, wholeW);
|
|
178
|
+
const maxB = maximize(one, 'blue', one.b0 + 1, one.b1, wholeR, wholeG, wholeB, wholeW);
|
|
179
|
+
let direction;
|
|
180
|
+
if (maxR.maximum >= maxG.maximum && maxR.maximum >= maxB.maximum) {
|
|
181
|
+
if (maxR.cutLocation < 0) return false;
|
|
182
|
+
direction = 'red';
|
|
183
|
+
} else if (maxG.maximum >= maxR.maximum && maxG.maximum >= maxB.maximum) {
|
|
184
|
+
direction = 'green';
|
|
185
|
+
} else {
|
|
186
|
+
direction = 'blue';
|
|
187
|
+
}
|
|
188
|
+
two.r1 = one.r1;
|
|
189
|
+
two.g1 = one.g1;
|
|
190
|
+
two.b1 = one.b1;
|
|
191
|
+
switch (direction) {
|
|
192
|
+
case 'red':
|
|
193
|
+
one.r1 = maxR.cutLocation;
|
|
194
|
+
two.r0 = one.r1;
|
|
195
|
+
two.g0 = one.g0;
|
|
196
|
+
two.b0 = one.b0;
|
|
197
|
+
break;
|
|
198
|
+
case 'green':
|
|
199
|
+
one.g1 = maxG.cutLocation;
|
|
200
|
+
two.r0 = one.r0;
|
|
201
|
+
two.g0 = one.g1;
|
|
202
|
+
two.b0 = one.b0;
|
|
203
|
+
break;
|
|
204
|
+
case 'blue':
|
|
205
|
+
one.b1 = maxB.cutLocation;
|
|
206
|
+
two.r0 = one.r0;
|
|
207
|
+
two.g0 = one.g0;
|
|
208
|
+
two.b0 = one.b1;
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
one.vol = (one.r1 - one.r0) * (one.g1 - one.g0) * (one.b1 - one.b0);
|
|
212
|
+
two.vol = (two.r1 - two.r0) * (two.g1 - two.g0) * (two.b1 - two.b0);
|
|
213
|
+
return true;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// Greedily split the colour cube.
|
|
217
|
+
const cubes = Array.from({
|
|
218
|
+
length: maxColors
|
|
219
|
+
}, makeBox);
|
|
220
|
+
const volumeVariance = new Array(maxColors).fill(0.0);
|
|
221
|
+
const firstCube = boxAt(cubes, 0);
|
|
222
|
+
firstCube.r0 = 0;
|
|
223
|
+
firstCube.g0 = 0;
|
|
224
|
+
firstCube.b0 = 0;
|
|
225
|
+
firstCube.r1 = SIDE_LENGTH - 1;
|
|
226
|
+
firstCube.g1 = SIDE_LENGTH - 1;
|
|
227
|
+
firstCube.b1 = SIDE_LENGTH - 1;
|
|
228
|
+
let generatedColorCount = maxColors;
|
|
229
|
+
let next = 0;
|
|
230
|
+
for (let i = 1; i < maxColors; i++) {
|
|
231
|
+
if (cut(boxAt(cubes, next), boxAt(cubes, i))) {
|
|
232
|
+
volumeVariance[next] = boxAt(cubes, next).vol > 1 ? variance(boxAt(cubes, next)) : 0.0;
|
|
233
|
+
volumeVariance[i] = boxAt(cubes, i).vol > 1 ? variance(boxAt(cubes, i)) : 0.0;
|
|
234
|
+
} else {
|
|
235
|
+
volumeVariance[next] = 0.0;
|
|
236
|
+
i--;
|
|
237
|
+
}
|
|
238
|
+
next = 0;
|
|
239
|
+
let temp = cell(volumeVariance, 0);
|
|
240
|
+
for (let j = 1; j <= i; j++) {
|
|
241
|
+
if (cell(volumeVariance, j) > temp) {
|
|
242
|
+
temp = cell(volumeVariance, j);
|
|
243
|
+
next = j;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (temp <= 0.0) {
|
|
247
|
+
generatedColorCount = i + 1;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Mean colour of each box.
|
|
253
|
+
const colors = [];
|
|
254
|
+
for (let i = 0; i < generatedColorCount; i++) {
|
|
255
|
+
const cube = boxAt(cubes, i);
|
|
256
|
+
const weight = volume(cube, weights);
|
|
257
|
+
if (weight > 0) {
|
|
258
|
+
const r = Math.round(volume(cube, momentsR) / weight);
|
|
259
|
+
const g = Math.round(volume(cube, momentsG) / weight);
|
|
260
|
+
const b = Math.round(volume(cube, momentsB) / weight);
|
|
261
|
+
colors.push((255 << 24 | (r & 0x0ff) << 16 | (g & 0x0ff) << 8 | b & 0x0ff) >>> 0);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return colors;
|
|
265
|
+
}
|
|
266
|
+
//# sourceMappingURL=quantizer-wu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_colorUtils","require","_quantizerMap","INDEX_BITS","SIDE_LENGTH","TOTAL_SIZE","makeBox","r0","r1","g0","g1","b0","b1","vol","cell","grid","index","value","undefined","RangeError","boxAt","cubes","box","getIndex","r","g","b","quantizeWu","pixels","maxColors","weights","Array","fill","momentsR","momentsG","momentsB","moments","counts","countByColor","bitsToRemove","pixel","count","entries","red","redFromArgb","green","greenFromArgb","blue","blueFromArgb","area","areaR","areaG","areaB","area2","line","lineR","lineG","lineB","line2","prev","volume","cube","moment","bottom","direction","top","position","variance","dr","dg","db","xx","hypotenuse","maximize","first","last","wholeR","wholeG","wholeB","wholeW","bottomR","bottomG","bottomB","bottomW","max","cut","i","halfR","halfG","halfB","halfW","temp","cutLocation","maximum","one","two","maxR","maxG","maxB","from","length","volumeVariance","firstCube","generatedColorCount","next","j","colors","weight","Math","round","push"],"sourceRoot":"../../../../src","sources":["theme/color-engine/quantizer-wu.ts"],"mappings":";;;;;;AASA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAME,UAAU,GAAG,CAAC;AACpB,MAAMC,WAAW,GAAG,EAAE,CAAC,CAAC;AACxB,MAAMC,UAAU,GAAG,KAAK,CAAC,CAAC;;AAc1B,MAAMC,OAAO,GAAGA,CAAA,MAAY;EAAEC,EAAE,EAAE,CAAC;EAAEC,EAAE,EAAE,CAAC;EAAEC,EAAE,EAAE,CAAC;EAAEC,EAAE,EAAE,CAAC;EAAEC,EAAE,EAAE,CAAC;EAAEC,EAAE,EAAE,CAAC;EAAEC,GAAG,EAAE;AAAE,CAAC,CAAC;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,IAAIA,CAACC,IAAc,EAAEC,KAAa,EAAU;EACnD,MAAMC,KAAK,GAAGF,IAAI,CAACC,KAAK,CAAC;EACzB,IAAIC,KAAK,KAAKC,SAAS,EAAE,MAAM,IAAIC,UAAU,CAAC,wBAAwBH,KAAK,eAAe,CAAC;EAC3F,OAAOC,KAAK;AACd;;AAEA;AACA,SAASG,KAAKA,CAACC,KAAY,EAAEL,KAAa,EAAO;EAC/C,MAAMM,GAAG,GAAGD,KAAK,CAACL,KAAK,CAAC;EACxB,IAAIM,GAAG,KAAKJ,SAAS,EAAE,MAAM,IAAIC,UAAU,CAAC,uBAAuBH,KAAK,eAAe,CAAC;EACxF,OAAOM,GAAG;AACZ;AAEA,SAASC,QAAQA,C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