@angular/material 19.0.0-next.8 → 19.0.0-rc.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/_index.scss +1 -2
- package/autocomplete/_autocomplete-theme.scss +37 -24
- package/autocomplete/index.d.ts +5 -6
- package/badge/_badge-theme.scss +38 -24
- package/bottom-sheet/_bottom-sheet-theme.scss +32 -20
- package/button/_button-theme.scss +229 -105
- package/button/_fab-theme.scss +95 -44
- package/button/_icon-button-theme.scss +38 -25
- package/button/index.d.ts +3 -3
- package/button-toggle/_button-toggle-theme.scss +62 -37
- package/card/_card-theme.scss +79 -38
- package/card/index.d.ts +2 -3
- package/checkbox/_checkbox-theme.scss +16 -10
- package/chips/_chips-theme.scss +64 -30
- package/core/_core-theme.scss +55 -37
- package/core/_core.scss +3 -6
- package/core/option/_optgroup-theme.scss +29 -18
- package/core/option/_option-theme.scss +34 -21
- package/core/ripple/_ripple-theme.scss +33 -21
- package/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +49 -23
- package/core/theming/_config-validation.scss +4 -4
- package/core/theming/_definition.scss +12 -2
- package/core/tokens/_m3-system.scss +86 -42
- package/core/tokens/_token-utils.scss +91 -34
- package/core/tokens/m2/mat/_badge.scss +12 -3
- package/core/tokens/m2/mdc/_radio.scss +1 -1
- package/core/tokens/m3/definitions/_md-comp-elevated-card.scss +1 -1
- package/core/tokens/m3/mat/_badge.scss +6 -3
- package/datepicker/_datepicker-theme.scss +53 -32
- package/datepicker/index.d.ts +33 -34
- package/dialog/_dialog-theme.scss +46 -23
- package/divider/_divider-theme.scss +28 -17
- package/expansion/_expansion-theme.scss +36 -24
- package/fesm2022/autocomplete/testing.mjs +2 -5
- package/fesm2022/autocomplete/testing.mjs.map +1 -1
- package/fesm2022/autocomplete.mjs +225 -148
- package/fesm2022/autocomplete.mjs.map +1 -1
- package/fesm2022/badge/testing.mjs +2 -5
- package/fesm2022/badge/testing.mjs.map +1 -1
- package/fesm2022/badge.mjs +45 -35
- package/fesm2022/badge.mjs.map +1 -1
- package/fesm2022/bottom-sheet/testing.mjs +1 -1
- package/fesm2022/bottom-sheet/testing.mjs.map +1 -1
- package/fesm2022/bottom-sheet.mjs +80 -58
- package/fesm2022/bottom-sheet.mjs.map +1 -1
- package/fesm2022/button/testing.mjs +2 -2
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/button-toggle/testing.mjs +4 -7
- package/fesm2022/button-toggle/testing.mjs.map +1 -1
- package/fesm2022/button-toggle.mjs +82 -45
- package/fesm2022/button-toggle.mjs.map +1 -1
- package/fesm2022/button.mjs +106 -79
- package/fesm2022/button.mjs.map +1 -1
- package/fesm2022/card/testing.mjs +3 -6
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/card.mjs +56 -69
- package/fesm2022/card.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs +4 -7
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/checkbox.mjs +104 -62
- package/fesm2022/checkbox.mjs.map +1 -1
- package/fesm2022/chips/testing.mjs +11 -14
- package/fesm2022/chips/testing.mjs.map +1 -1
- package/fesm2022/chips.mjs +322 -276
- package/fesm2022/chips.mjs.map +1 -1
- package/fesm2022/core/testing.mjs +5 -11
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +242 -187
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker/testing.mjs +13 -22
- package/fesm2022/datepicker/testing.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +827 -582
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/dialog/testing.mjs +15 -10
- package/fesm2022/dialog/testing.mjs.map +1 -1
- package/fesm2022/dialog.mjs +221 -156
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/divider/testing.mjs +1 -1
- package/fesm2022/divider/testing.mjs.map +1 -1
- package/fesm2022/divider.mjs +10 -12
- package/fesm2022/divider.mjs.map +1 -1
- package/fesm2022/expansion/testing.mjs +7 -10
- package/fesm2022/expansion/testing.mjs.map +1 -1
- package/fesm2022/expansion.mjs +86 -80
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs +12 -15
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +179 -132
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/grid-list/testing.mjs +11 -17
- package/fesm2022/grid-list/testing.mjs.map +1 -1
- package/fesm2022/grid-list.mjs +75 -56
- package/fesm2022/grid-list.mjs.map +1 -1
- package/fesm2022/icon/testing.mjs +8 -8
- package/fesm2022/icon/testing.mjs.map +1 -1
- package/fesm2022/icon.mjs +66 -46
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/input/testing.mjs +3 -3
- package/fesm2022/input/testing.mjs.map +1 -1
- package/fesm2022/input.mjs +103 -72
- package/fesm2022/input.mjs.map +1 -1
- package/fesm2022/list/testing.mjs +21 -38
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs +197 -195
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs +3 -6
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +178 -127
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/paginator/testing.mjs +10 -13
- package/fesm2022/paginator/testing.mjs.map +1 -1
- package/fesm2022/paginator.mjs +83 -58
- package/fesm2022/paginator.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/progress-bar.mjs +36 -35
- package/fesm2022/progress-bar.mjs.map +1 -1
- package/fesm2022/progress-spinner/testing.mjs +1 -1
- package/fesm2022/progress-spinner/testing.mjs.map +1 -1
- package/fesm2022/progress-spinner.mjs +28 -14
- package/fesm2022/progress-spinner.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs +6 -12
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/radio.mjs +123 -87
- package/fesm2022/radio.mjs.map +1 -1
- package/fesm2022/select/testing.mjs +6 -9
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/select.mjs +219 -182
- package/fesm2022/select.mjs.map +1 -1
- package/fesm2022/sidenav/testing.mjs +6 -6
- package/fesm2022/sidenav/testing.mjs.map +1 -1
- package/fesm2022/sidenav.mjs +136 -125
- package/fesm2022/sidenav.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs +3 -6
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +77 -47
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/slider/testing.mjs +2 -2
- package/fesm2022/slider/testing.mjs.map +1 -1
- package/fesm2022/slider.mjs +262 -194
- package/fesm2022/slider.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs +4 -7
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/snack-bar.mjs +143 -111
- package/fesm2022/snack-bar.mjs.map +1 -1
- package/fesm2022/sort/testing.mjs +3 -6
- package/fesm2022/sort/testing.mjs.map +1 -1
- package/fesm2022/sort.mjs +94 -74
- package/fesm2022/sort.mjs.map +1 -1
- package/fesm2022/stepper/testing.mjs +4 -4
- package/fesm2022/stepper/testing.mjs.map +1 -1
- package/fesm2022/stepper.mjs +146 -113
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table/testing.mjs +13 -25
- package/fesm2022/table/testing.mjs.map +1 -1
- package/fesm2022/table.mjs +183 -194
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs +5 -5
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +329 -251
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/timepicker/testing.mjs +7 -16
- package/fesm2022/timepicker/testing.mjs.map +1 -1
- package/fesm2022/timepicker.mjs +160 -155
- package/fesm2022/timepicker.mjs.map +1 -1
- package/fesm2022/toolbar/testing.mjs +2 -5
- package/fesm2022/toolbar/testing.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +26 -17
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tooltip/testing.mjs +6 -9
- package/fesm2022/tooltip/testing.mjs.map +1 -1
- package/fesm2022/tooltip.mjs +97 -74
- package/fesm2022/tooltip.mjs.map +1 -1
- package/fesm2022/tree/testing.mjs +3 -6
- package/fesm2022/tree/testing.mjs.map +1 -1
- package/fesm2022/tree.mjs +57 -61
- package/fesm2022/tree.mjs.map +1 -1
- package/form-field/_form-field-theme.scss +114 -61
- package/form-field/index.d.ts +9 -10
- package/grid-list/_grid-list-theme.scss +25 -15
- package/icon/_icon-theme.scss +22 -14
- package/input/_input-theme.scss +18 -11
- package/list/_list-theme.scss +89 -47
- package/list/index.d.ts +20 -21
- package/menu/_menu-theme.scss +33 -21
- package/menu/index.d.ts +8 -9
- package/package.json +2 -2
- package/paginator/_paginator-theme.scss +39 -23
- package/prebuilt-themes/azure-blue.css +1 -1
- package/prebuilt-themes/cyan-orange.css +1 -1
- package/prebuilt-themes/deeppurple-amber.css +1 -1
- package/prebuilt-themes/indigo-pink.css +1 -1
- package/prebuilt-themes/magenta-violet.css +1 -1
- package/prebuilt-themes/pink-bluegrey.css +1 -1
- package/prebuilt-themes/purple-green.css +1 -1
- package/prebuilt-themes/rose-red.css +1 -1
- package/progress-bar/_progress-bar-theme.scss +20 -16
- package/progress-spinner/_progress-spinner-theme.scss +41 -25
- package/progress-spinner/index.d.ts +3 -4
- package/radio/_radio-theme.scss +60 -32
- package/radio/index.d.ts +2 -3
- package/schematics/collection.json +3 -3
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-add/theming/create-custom-theme.js +1 -6
- package/schematics/ng-add/theming/create-custom-theme.mjs +1 -6
- package/schematics/ng-generate/{m3-theme → theme-color}/index_bundled.js +480 -288
- package/schematics/ng-generate/theme-color/index_bundled.js.map +7 -0
- package/schematics/ng-generate/{m3-theme → theme-color}/schema.json +7 -13
- package/schematics/ng-update/index_bundled.js +6 -1
- package/schematics/ng-update/index_bundled.js.map +1 -1
- package/select/_select-theme.scss +38 -25
- package/select/index.d.ts +6 -7
- package/sidenav/_sidenav-theme.scss +28 -17
- package/slide-toggle/_slide-toggle-theme.scss +52 -28
- package/slider/_slider-theme.scss +62 -38
- package/snack-bar/_snack-bar-theme.scss +29 -17
- package/sort/_sort-theme.scss +33 -21
- package/stepper/_stepper-theme.scss +40 -27
- package/stepper/index.d.ts +14 -15
- package/table/_table-theme.scss +36 -23
- package/tabs/_tabs-theme.scss +97 -50
- package/tabs/index.d.ts +2 -2
- package/timepicker/_timepicker-theme.scss +37 -24
- package/toolbar/_toolbar-theme.scss +35 -22
- package/tooltip/_tooltip-theme.scss +18 -15
- package/tooltip/index.d.ts +5 -6
- package/tree/_tree-theme.scss +33 -21
- package/schematics/ng-generate/m3-theme/index_bundled.js.map +0 -7
|
@@ -50,13 +50,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/
|
|
54
|
-
var
|
|
55
|
-
__export(
|
|
56
|
-
default: () =>
|
|
53
|
+
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/theme-color/index.mjs
|
|
54
|
+
var theme_color_exports = {};
|
|
55
|
+
__export(theme_color_exports, {
|
|
56
|
+
default: () => theme_color_default,
|
|
57
57
|
generateSCSSTheme: () => generateSCSSTheme
|
|
58
58
|
});
|
|
59
|
-
module.exports = __toCommonJS(
|
|
59
|
+
module.exports = __toCommonJS(theme_color_exports);
|
|
60
60
|
|
|
61
61
|
// node_modules/@material/material-color-utilities/utils/math_utils.js
|
|
62
62
|
function signum(num) {
|
|
@@ -1217,8 +1217,8 @@ var DynamicColor = class {
|
|
|
1217
1217
|
const farther = aIsNearer ? roleB : roleA;
|
|
1218
1218
|
const amNearer = this.name === nearer.name;
|
|
1219
1219
|
const expansionDir = scheme.isDark ? 1 : -1;
|
|
1220
|
-
const nContrast = nearer.contrastCurve.
|
|
1221
|
-
const fContrast = farther.contrastCurve.
|
|
1220
|
+
const nContrast = nearer.contrastCurve.get(scheme.contrastLevel);
|
|
1221
|
+
const fContrast = farther.contrastCurve.get(scheme.contrastLevel);
|
|
1222
1222
|
const nInitialTone = nearer.tone(scheme);
|
|
1223
1223
|
let nTone = Contrast.ratioOfTones(bgTone, nInitialTone) >= nContrast ? nInitialTone : DynamicColor.foregroundTone(bgTone, nContrast);
|
|
1224
1224
|
const fInitialTone = farther.tone(scheme);
|
|
@@ -1267,7 +1267,7 @@ var DynamicColor = class {
|
|
|
1267
1267
|
return answer;
|
|
1268
1268
|
}
|
|
1269
1269
|
const bgTone = this.background(scheme).getTone(scheme);
|
|
1270
|
-
const desiredRatio = this.contrastCurve.
|
|
1270
|
+
const desiredRatio = this.contrastCurve.get(scheme.contrastLevel);
|
|
1271
1271
|
if (Contrast.ratioOfTones(bgTone, answer) >= desiredRatio) {
|
|
1272
1272
|
} else {
|
|
1273
1273
|
answer = DynamicColor.foregroundTone(bgTone, desiredRatio);
|
|
@@ -1335,19 +1335,82 @@ var DynamicColor = class {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
};
|
|
1337
1337
|
|
|
1338
|
-
// node_modules/@material/material-color-utilities/
|
|
1339
|
-
var
|
|
1340
|
-
(
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
}
|
|
1338
|
+
// node_modules/@material/material-color-utilities/palettes/tonal_palette.js
|
|
1339
|
+
var TonalPalette = class {
|
|
1340
|
+
static fromInt(argb) {
|
|
1341
|
+
const hct = Hct.fromInt(argb);
|
|
1342
|
+
return TonalPalette.fromHct(hct);
|
|
1343
|
+
}
|
|
1344
|
+
static fromHct(hct) {
|
|
1345
|
+
return new TonalPalette(hct.hue, hct.chroma, hct);
|
|
1346
|
+
}
|
|
1347
|
+
static fromHueAndChroma(hue, chroma) {
|
|
1348
|
+
const keyColor = new KeyColor(hue, chroma).create();
|
|
1349
|
+
return new TonalPalette(hue, chroma, keyColor);
|
|
1350
|
+
}
|
|
1351
|
+
constructor(hue, chroma, keyColor) {
|
|
1352
|
+
this.hue = hue;
|
|
1353
|
+
this.chroma = chroma;
|
|
1354
|
+
this.keyColor = keyColor;
|
|
1355
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
1356
|
+
}
|
|
1357
|
+
tone(tone) {
|
|
1358
|
+
let argb = this.cache.get(tone);
|
|
1359
|
+
if (argb === void 0) {
|
|
1360
|
+
argb = Hct.from(this.hue, this.chroma, tone).toInt();
|
|
1361
|
+
this.cache.set(tone, argb);
|
|
1362
|
+
}
|
|
1363
|
+
return argb;
|
|
1364
|
+
}
|
|
1365
|
+
getHct(tone) {
|
|
1366
|
+
return Hct.fromInt(this.tone(tone));
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
var KeyColor = class {
|
|
1370
|
+
constructor(hue, requestedChroma) {
|
|
1371
|
+
this.hue = hue;
|
|
1372
|
+
this.requestedChroma = requestedChroma;
|
|
1373
|
+
this.chromaCache = /* @__PURE__ */ new Map();
|
|
1374
|
+
this.maxChromaValue = 200;
|
|
1375
|
+
}
|
|
1376
|
+
create() {
|
|
1377
|
+
const pivotTone = 50;
|
|
1378
|
+
const toneStepSize = 1;
|
|
1379
|
+
const epsilon = 0.01;
|
|
1380
|
+
let lowerTone = 0;
|
|
1381
|
+
let upperTone = 100;
|
|
1382
|
+
while (lowerTone < upperTone) {
|
|
1383
|
+
const midTone = Math.floor((lowerTone + upperTone) / 2);
|
|
1384
|
+
const isAscending = this.maxChroma(midTone) < this.maxChroma(midTone + toneStepSize);
|
|
1385
|
+
const sufficientChroma = this.maxChroma(midTone) >= this.requestedChroma - epsilon;
|
|
1386
|
+
if (sufficientChroma) {
|
|
1387
|
+
if (Math.abs(lowerTone - pivotTone) < Math.abs(upperTone - pivotTone)) {
|
|
1388
|
+
upperTone = midTone;
|
|
1389
|
+
} else {
|
|
1390
|
+
if (lowerTone === midTone) {
|
|
1391
|
+
return Hct.from(this.hue, this.requestedChroma, lowerTone);
|
|
1392
|
+
}
|
|
1393
|
+
lowerTone = midTone;
|
|
1394
|
+
}
|
|
1395
|
+
} else {
|
|
1396
|
+
if (isAscending) {
|
|
1397
|
+
lowerTone = midTone + toneStepSize;
|
|
1398
|
+
} else {
|
|
1399
|
+
upperTone = midTone;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
return Hct.from(this.hue, this.requestedChroma, lowerTone);
|
|
1404
|
+
}
|
|
1405
|
+
maxChroma(tone) {
|
|
1406
|
+
if (this.chromaCache.has(tone)) {
|
|
1407
|
+
return this.chromaCache.get(tone);
|
|
1408
|
+
}
|
|
1409
|
+
const chroma = Hct.from(this.hue, this.maxChromaValue, tone).chroma;
|
|
1410
|
+
this.chromaCache.set(tone, chroma);
|
|
1411
|
+
return chroma;
|
|
1412
|
+
}
|
|
1413
|
+
};
|
|
1351
1414
|
|
|
1352
1415
|
// node_modules/@material/material-color-utilities/dynamiccolor/contrast_curve.js
|
|
1353
1416
|
var ContrastCurve = class {
|
|
@@ -1357,7 +1420,7 @@ var ContrastCurve = class {
|
|
|
1357
1420
|
this.medium = medium;
|
|
1358
1421
|
this.high = high;
|
|
1359
1422
|
}
|
|
1360
|
-
|
|
1423
|
+
get(contrastLevel) {
|
|
1361
1424
|
if (contrastLevel <= -1) {
|
|
1362
1425
|
return this.low;
|
|
1363
1426
|
} else if (contrastLevel < 0) {
|
|
@@ -1383,6 +1446,20 @@ var ToneDeltaPair = class {
|
|
|
1383
1446
|
}
|
|
1384
1447
|
};
|
|
1385
1448
|
|
|
1449
|
+
// node_modules/@material/material-color-utilities/dynamiccolor/variant.js
|
|
1450
|
+
var Variant;
|
|
1451
|
+
(function(Variant2) {
|
|
1452
|
+
Variant2[Variant2["MONOCHROME"] = 0] = "MONOCHROME";
|
|
1453
|
+
Variant2[Variant2["NEUTRAL"] = 1] = "NEUTRAL";
|
|
1454
|
+
Variant2[Variant2["TONAL_SPOT"] = 2] = "TONAL_SPOT";
|
|
1455
|
+
Variant2[Variant2["VIBRANT"] = 3] = "VIBRANT";
|
|
1456
|
+
Variant2[Variant2["EXPRESSIVE"] = 4] = "EXPRESSIVE";
|
|
1457
|
+
Variant2[Variant2["FIDELITY"] = 5] = "FIDELITY";
|
|
1458
|
+
Variant2[Variant2["CONTENT"] = 6] = "CONTENT";
|
|
1459
|
+
Variant2[Variant2["RAINBOW"] = 7] = "RAINBOW";
|
|
1460
|
+
Variant2[Variant2["FRUIT_SALAD"] = 8] = "FRUIT_SALAD";
|
|
1461
|
+
})(Variant || (Variant = {}));
|
|
1462
|
+
|
|
1386
1463
|
// node_modules/@material/material-color-utilities/dynamiccolor/material_dynamic_colors.js
|
|
1387
1464
|
function isFidelity(scheme) {
|
|
1388
1465
|
return scheme.variant === Variant.FIDELITY || scheme.variant === Variant.CONTENT;
|
|
@@ -1414,23 +1491,6 @@ function findDesiredChromaByTone(hue, chroma, tone, byDecreasingTone) {
|
|
|
1414
1491
|
}
|
|
1415
1492
|
return answer;
|
|
1416
1493
|
}
|
|
1417
|
-
function viewingConditionsForAlbers(scheme) {
|
|
1418
|
-
return ViewingConditions.make(
|
|
1419
|
-
void 0,
|
|
1420
|
-
void 0,
|
|
1421
|
-
scheme.isDark ? 30 : 80,
|
|
1422
|
-
void 0,
|
|
1423
|
-
void 0
|
|
1424
|
-
);
|
|
1425
|
-
}
|
|
1426
|
-
function performAlbers(prealbers, scheme) {
|
|
1427
|
-
const albersd = prealbers.inViewingConditions(viewingConditionsForAlbers(scheme));
|
|
1428
|
-
if (DynamicColor.tonePrefersLightForeground(prealbers.tone) && !DynamicColor.toneAllowsLightForeground(albersd.tone)) {
|
|
1429
|
-
return DynamicColor.enableLightForeground(prealbers.tone);
|
|
1430
|
-
} else {
|
|
1431
|
-
return DynamicColor.enableLightForeground(albersd.tone);
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
1494
|
var MaterialDynamicColors = class {
|
|
1435
1495
|
static highestSurface(s) {
|
|
1436
1496
|
return s.isDark ? MaterialDynamicColors.surfaceBright : MaterialDynamicColors.surfaceDim;
|
|
@@ -1484,43 +1544,43 @@ MaterialDynamicColors.surface = DynamicColor.fromPalette({
|
|
|
1484
1544
|
MaterialDynamicColors.surfaceDim = DynamicColor.fromPalette({
|
|
1485
1545
|
name: "surface_dim",
|
|
1486
1546
|
palette: (s) => s.neutralPalette,
|
|
1487
|
-
tone: (s) => s.isDark ? 6 : 87,
|
|
1547
|
+
tone: (s) => s.isDark ? 6 : new ContrastCurve(87, 87, 80, 75).get(s.contrastLevel),
|
|
1488
1548
|
isBackground: true
|
|
1489
1549
|
});
|
|
1490
1550
|
MaterialDynamicColors.surfaceBright = DynamicColor.fromPalette({
|
|
1491
1551
|
name: "surface_bright",
|
|
1492
1552
|
palette: (s) => s.neutralPalette,
|
|
1493
|
-
tone: (s) => s.isDark ? 24 : 98,
|
|
1553
|
+
tone: (s) => s.isDark ? new ContrastCurve(24, 24, 29, 34).get(s.contrastLevel) : 98,
|
|
1494
1554
|
isBackground: true
|
|
1495
1555
|
});
|
|
1496
1556
|
MaterialDynamicColors.surfaceContainerLowest = DynamicColor.fromPalette({
|
|
1497
1557
|
name: "surface_container_lowest",
|
|
1498
1558
|
palette: (s) => s.neutralPalette,
|
|
1499
|
-
tone: (s) => s.isDark ? 4 : 100,
|
|
1559
|
+
tone: (s) => s.isDark ? new ContrastCurve(4, 4, 2, 0).get(s.contrastLevel) : 100,
|
|
1500
1560
|
isBackground: true
|
|
1501
1561
|
});
|
|
1502
1562
|
MaterialDynamicColors.surfaceContainerLow = DynamicColor.fromPalette({
|
|
1503
1563
|
name: "surface_container_low",
|
|
1504
1564
|
palette: (s) => s.neutralPalette,
|
|
1505
|
-
tone: (s) => s.isDark ? 10 : 96,
|
|
1565
|
+
tone: (s) => s.isDark ? new ContrastCurve(10, 10, 11, 12).get(s.contrastLevel) : new ContrastCurve(96, 96, 96, 95).get(s.contrastLevel),
|
|
1506
1566
|
isBackground: true
|
|
1507
1567
|
});
|
|
1508
1568
|
MaterialDynamicColors.surfaceContainer = DynamicColor.fromPalette({
|
|
1509
1569
|
name: "surface_container",
|
|
1510
1570
|
palette: (s) => s.neutralPalette,
|
|
1511
|
-
tone: (s) => s.isDark ? 12 : 94,
|
|
1571
|
+
tone: (s) => s.isDark ? new ContrastCurve(12, 12, 16, 20).get(s.contrastLevel) : new ContrastCurve(94, 94, 92, 90).get(s.contrastLevel),
|
|
1512
1572
|
isBackground: true
|
|
1513
1573
|
});
|
|
1514
1574
|
MaterialDynamicColors.surfaceContainerHigh = DynamicColor.fromPalette({
|
|
1515
1575
|
name: "surface_container_high",
|
|
1516
1576
|
palette: (s) => s.neutralPalette,
|
|
1517
|
-
tone: (s) => s.isDark ? 17 : 92,
|
|
1577
|
+
tone: (s) => s.isDark ? new ContrastCurve(17, 17, 21, 25).get(s.contrastLevel) : new ContrastCurve(92, 92, 88, 85).get(s.contrastLevel),
|
|
1518
1578
|
isBackground: true
|
|
1519
1579
|
});
|
|
1520
1580
|
MaterialDynamicColors.surfaceContainerHighest = DynamicColor.fromPalette({
|
|
1521
1581
|
name: "surface_container_highest",
|
|
1522
1582
|
palette: (s) => s.neutralPalette,
|
|
1523
|
-
tone: (s) => s.isDark ? 22 : 90,
|
|
1583
|
+
tone: (s) => s.isDark ? new ContrastCurve(22, 22, 26, 30).get(s.contrastLevel) : new ContrastCurve(90, 90, 84, 80).get(s.contrastLevel),
|
|
1524
1584
|
isBackground: true
|
|
1525
1585
|
});
|
|
1526
1586
|
MaterialDynamicColors.onSurface = DynamicColor.fromPalette({
|
|
@@ -1567,7 +1627,7 @@ MaterialDynamicColors.outlineVariant = DynamicColor.fromPalette({
|
|
|
1567
1627
|
palette: (s) => s.neutralVariantPalette,
|
|
1568
1628
|
tone: (s) => s.isDark ? 30 : 80,
|
|
1569
1629
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1570
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1630
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5)
|
|
1571
1631
|
});
|
|
1572
1632
|
MaterialDynamicColors.shadow = DynamicColor.fromPalette({
|
|
1573
1633
|
name: "shadow",
|
|
@@ -1596,8 +1656,8 @@ MaterialDynamicColors.primary = DynamicColor.fromPalette({
|
|
|
1596
1656
|
},
|
|
1597
1657
|
isBackground: true,
|
|
1598
1658
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1599
|
-
contrastCurve: new ContrastCurve(3, 4.5, 7,
|
|
1600
|
-
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryContainer, MaterialDynamicColors.primary,
|
|
1659
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 7),
|
|
1660
|
+
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryContainer, MaterialDynamicColors.primary, 10, "nearer", false)
|
|
1601
1661
|
});
|
|
1602
1662
|
MaterialDynamicColors.onPrimary = DynamicColor.fromPalette({
|
|
1603
1663
|
name: "on_primary",
|
|
@@ -1616,7 +1676,7 @@ MaterialDynamicColors.primaryContainer = DynamicColor.fromPalette({
|
|
|
1616
1676
|
palette: (s) => s.primaryPalette,
|
|
1617
1677
|
tone: (s) => {
|
|
1618
1678
|
if (isFidelity(s)) {
|
|
1619
|
-
return
|
|
1679
|
+
return s.sourceColorHct.tone;
|
|
1620
1680
|
}
|
|
1621
1681
|
if (isMonochrome(s)) {
|
|
1622
1682
|
return s.isDark ? 85 : 25;
|
|
@@ -1625,8 +1685,8 @@ MaterialDynamicColors.primaryContainer = DynamicColor.fromPalette({
|
|
|
1625
1685
|
},
|
|
1626
1686
|
isBackground: true,
|
|
1627
1687
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1628
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1629
|
-
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryContainer, MaterialDynamicColors.primary,
|
|
1688
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1689
|
+
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryContainer, MaterialDynamicColors.primary, 10, "nearer", false)
|
|
1630
1690
|
});
|
|
1631
1691
|
MaterialDynamicColors.onPrimaryContainer = DynamicColor.fromPalette({
|
|
1632
1692
|
name: "on_primary_container",
|
|
@@ -1638,17 +1698,17 @@ MaterialDynamicColors.onPrimaryContainer = DynamicColor.fromPalette({
|
|
|
1638
1698
|
if (isMonochrome(s)) {
|
|
1639
1699
|
return s.isDark ? 0 : 100;
|
|
1640
1700
|
}
|
|
1641
|
-
return s.isDark ? 90 :
|
|
1701
|
+
return s.isDark ? 90 : 30;
|
|
1642
1702
|
},
|
|
1643
1703
|
background: (s) => MaterialDynamicColors.primaryContainer,
|
|
1644
|
-
contrastCurve: new ContrastCurve(4.5, 7, 11
|
|
1704
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
|
|
1645
1705
|
});
|
|
1646
1706
|
MaterialDynamicColors.inversePrimary = DynamicColor.fromPalette({
|
|
1647
1707
|
name: "inverse_primary",
|
|
1648
1708
|
palette: (s) => s.primaryPalette,
|
|
1649
1709
|
tone: (s) => s.isDark ? 40 : 80,
|
|
1650
1710
|
background: (s) => MaterialDynamicColors.inverseSurface,
|
|
1651
|
-
contrastCurve: new ContrastCurve(3, 4.5, 7,
|
|
1711
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 7)
|
|
1652
1712
|
});
|
|
1653
1713
|
MaterialDynamicColors.secondary = DynamicColor.fromPalette({
|
|
1654
1714
|
name: "secondary",
|
|
@@ -1656,8 +1716,8 @@ MaterialDynamicColors.secondary = DynamicColor.fromPalette({
|
|
|
1656
1716
|
tone: (s) => s.isDark ? 80 : 40,
|
|
1657
1717
|
isBackground: true,
|
|
1658
1718
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1659
|
-
contrastCurve: new ContrastCurve(3, 4.5, 7,
|
|
1660
|
-
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryContainer, MaterialDynamicColors.secondary,
|
|
1719
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 7),
|
|
1720
|
+
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryContainer, MaterialDynamicColors.secondary, 10, "nearer", false)
|
|
1661
1721
|
});
|
|
1662
1722
|
MaterialDynamicColors.onSecondary = DynamicColor.fromPalette({
|
|
1663
1723
|
name: "on_secondary",
|
|
@@ -1683,26 +1743,27 @@ MaterialDynamicColors.secondaryContainer = DynamicColor.fromPalette({
|
|
|
1683
1743
|
if (!isFidelity(s)) {
|
|
1684
1744
|
return initialTone;
|
|
1685
1745
|
}
|
|
1686
|
-
|
|
1687
|
-
answer = performAlbers(s.secondaryPalette.getHct(answer), s);
|
|
1688
|
-
return answer;
|
|
1746
|
+
return findDesiredChromaByTone(s.secondaryPalette.hue, s.secondaryPalette.chroma, initialTone, s.isDark ? false : true);
|
|
1689
1747
|
},
|
|
1690
1748
|
isBackground: true,
|
|
1691
1749
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1692
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1693
|
-
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryContainer, MaterialDynamicColors.secondary,
|
|
1750
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1751
|
+
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryContainer, MaterialDynamicColors.secondary, 10, "nearer", false)
|
|
1694
1752
|
});
|
|
1695
1753
|
MaterialDynamicColors.onSecondaryContainer = DynamicColor.fromPalette({
|
|
1696
1754
|
name: "on_secondary_container",
|
|
1697
1755
|
palette: (s) => s.secondaryPalette,
|
|
1698
1756
|
tone: (s) => {
|
|
1699
|
-
if (
|
|
1757
|
+
if (isMonochrome(s)) {
|
|
1700
1758
|
return s.isDark ? 90 : 10;
|
|
1701
1759
|
}
|
|
1760
|
+
if (!isFidelity(s)) {
|
|
1761
|
+
return s.isDark ? 90 : 30;
|
|
1762
|
+
}
|
|
1702
1763
|
return DynamicColor.foregroundTone(MaterialDynamicColors.secondaryContainer.tone(s), 4.5);
|
|
1703
1764
|
},
|
|
1704
1765
|
background: (s) => MaterialDynamicColors.secondaryContainer,
|
|
1705
|
-
contrastCurve: new ContrastCurve(4.5, 7, 11
|
|
1766
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
|
|
1706
1767
|
});
|
|
1707
1768
|
MaterialDynamicColors.tertiary = DynamicColor.fromPalette({
|
|
1708
1769
|
name: "tertiary",
|
|
@@ -1715,8 +1776,8 @@ MaterialDynamicColors.tertiary = DynamicColor.fromPalette({
|
|
|
1715
1776
|
},
|
|
1716
1777
|
isBackground: true,
|
|
1717
1778
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1718
|
-
contrastCurve: new ContrastCurve(3, 4.5, 7,
|
|
1719
|
-
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer, MaterialDynamicColors.tertiary,
|
|
1779
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 7),
|
|
1780
|
+
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer, MaterialDynamicColors.tertiary, 10, "nearer", false)
|
|
1720
1781
|
});
|
|
1721
1782
|
MaterialDynamicColors.onTertiary = DynamicColor.fromPalette({
|
|
1722
1783
|
name: "on_tertiary",
|
|
@@ -1740,14 +1801,13 @@ MaterialDynamicColors.tertiaryContainer = DynamicColor.fromPalette({
|
|
|
1740
1801
|
if (!isFidelity(s)) {
|
|
1741
1802
|
return s.isDark ? 30 : 90;
|
|
1742
1803
|
}
|
|
1743
|
-
const
|
|
1744
|
-
const proposedHct = s.tertiaryPalette.getHct(albersTone);
|
|
1804
|
+
const proposedHct = s.tertiaryPalette.getHct(s.sourceColorHct.tone);
|
|
1745
1805
|
return DislikeAnalyzer.fixIfDisliked(proposedHct).tone;
|
|
1746
1806
|
},
|
|
1747
1807
|
isBackground: true,
|
|
1748
1808
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1749
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1750
|
-
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer, MaterialDynamicColors.tertiary,
|
|
1809
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1810
|
+
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer, MaterialDynamicColors.tertiary, 10, "nearer", false)
|
|
1751
1811
|
});
|
|
1752
1812
|
MaterialDynamicColors.onTertiaryContainer = DynamicColor.fromPalette({
|
|
1753
1813
|
name: "on_tertiary_container",
|
|
@@ -1757,12 +1817,12 @@ MaterialDynamicColors.onTertiaryContainer = DynamicColor.fromPalette({
|
|
|
1757
1817
|
return s.isDark ? 0 : 100;
|
|
1758
1818
|
}
|
|
1759
1819
|
if (!isFidelity(s)) {
|
|
1760
|
-
return s.isDark ? 90 :
|
|
1820
|
+
return s.isDark ? 90 : 30;
|
|
1761
1821
|
}
|
|
1762
1822
|
return DynamicColor.foregroundTone(MaterialDynamicColors.tertiaryContainer.tone(s), 4.5);
|
|
1763
1823
|
},
|
|
1764
1824
|
background: (s) => MaterialDynamicColors.tertiaryContainer,
|
|
1765
|
-
contrastCurve: new ContrastCurve(4.5, 7, 11
|
|
1825
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
|
|
1766
1826
|
});
|
|
1767
1827
|
MaterialDynamicColors.error = DynamicColor.fromPalette({
|
|
1768
1828
|
name: "error",
|
|
@@ -1770,8 +1830,8 @@ MaterialDynamicColors.error = DynamicColor.fromPalette({
|
|
|
1770
1830
|
tone: (s) => s.isDark ? 80 : 40,
|
|
1771
1831
|
isBackground: true,
|
|
1772
1832
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1773
|
-
contrastCurve: new ContrastCurve(3, 4.5, 7,
|
|
1774
|
-
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.errorContainer, MaterialDynamicColors.error,
|
|
1833
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 7),
|
|
1834
|
+
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.errorContainer, MaterialDynamicColors.error, 10, "nearer", false)
|
|
1775
1835
|
});
|
|
1776
1836
|
MaterialDynamicColors.onError = DynamicColor.fromPalette({
|
|
1777
1837
|
name: "on_error",
|
|
@@ -1786,15 +1846,20 @@ MaterialDynamicColors.errorContainer = DynamicColor.fromPalette({
|
|
|
1786
1846
|
tone: (s) => s.isDark ? 30 : 90,
|
|
1787
1847
|
isBackground: true,
|
|
1788
1848
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1789
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1790
|
-
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.errorContainer, MaterialDynamicColors.error,
|
|
1849
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1850
|
+
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.errorContainer, MaterialDynamicColors.error, 10, "nearer", false)
|
|
1791
1851
|
});
|
|
1792
1852
|
MaterialDynamicColors.onErrorContainer = DynamicColor.fromPalette({
|
|
1793
1853
|
name: "on_error_container",
|
|
1794
1854
|
palette: (s) => s.errorPalette,
|
|
1795
|
-
tone: (s) =>
|
|
1855
|
+
tone: (s) => {
|
|
1856
|
+
if (isMonochrome(s)) {
|
|
1857
|
+
return s.isDark ? 90 : 10;
|
|
1858
|
+
}
|
|
1859
|
+
return s.isDark ? 90 : 30;
|
|
1860
|
+
},
|
|
1796
1861
|
background: (s) => MaterialDynamicColors.errorContainer,
|
|
1797
|
-
contrastCurve: new ContrastCurve(4.5, 7, 11
|
|
1862
|
+
contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
|
|
1798
1863
|
});
|
|
1799
1864
|
MaterialDynamicColors.primaryFixed = DynamicColor.fromPalette({
|
|
1800
1865
|
name: "primary_fixed",
|
|
@@ -1802,7 +1867,7 @@ MaterialDynamicColors.primaryFixed = DynamicColor.fromPalette({
|
|
|
1802
1867
|
tone: (s) => isMonochrome(s) ? 40 : 90,
|
|
1803
1868
|
isBackground: true,
|
|
1804
1869
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1805
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1870
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1806
1871
|
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryFixed, MaterialDynamicColors.primaryFixedDim, 10, "lighter", true)
|
|
1807
1872
|
});
|
|
1808
1873
|
MaterialDynamicColors.primaryFixedDim = DynamicColor.fromPalette({
|
|
@@ -1811,7 +1876,7 @@ MaterialDynamicColors.primaryFixedDim = DynamicColor.fromPalette({
|
|
|
1811
1876
|
tone: (s) => isMonochrome(s) ? 30 : 80,
|
|
1812
1877
|
isBackground: true,
|
|
1813
1878
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1814
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1879
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1815
1880
|
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.primaryFixed, MaterialDynamicColors.primaryFixedDim, 10, "lighter", true)
|
|
1816
1881
|
});
|
|
1817
1882
|
MaterialDynamicColors.onPrimaryFixed = DynamicColor.fromPalette({
|
|
@@ -1836,7 +1901,7 @@ MaterialDynamicColors.secondaryFixed = DynamicColor.fromPalette({
|
|
|
1836
1901
|
tone: (s) => isMonochrome(s) ? 80 : 90,
|
|
1837
1902
|
isBackground: true,
|
|
1838
1903
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1839
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1904
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1840
1905
|
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryFixed, MaterialDynamicColors.secondaryFixedDim, 10, "lighter", true)
|
|
1841
1906
|
});
|
|
1842
1907
|
MaterialDynamicColors.secondaryFixedDim = DynamicColor.fromPalette({
|
|
@@ -1845,7 +1910,7 @@ MaterialDynamicColors.secondaryFixedDim = DynamicColor.fromPalette({
|
|
|
1845
1910
|
tone: (s) => isMonochrome(s) ? 70 : 80,
|
|
1846
1911
|
isBackground: true,
|
|
1847
1912
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1848
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1913
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1849
1914
|
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.secondaryFixed, MaterialDynamicColors.secondaryFixedDim, 10, "lighter", true)
|
|
1850
1915
|
});
|
|
1851
1916
|
MaterialDynamicColors.onSecondaryFixed = DynamicColor.fromPalette({
|
|
@@ -1870,7 +1935,7 @@ MaterialDynamicColors.tertiaryFixed = DynamicColor.fromPalette({
|
|
|
1870
1935
|
tone: (s) => isMonochrome(s) ? 40 : 90,
|
|
1871
1936
|
isBackground: true,
|
|
1872
1937
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1873
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1938
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1874
1939
|
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryFixed, MaterialDynamicColors.tertiaryFixedDim, 10, "lighter", true)
|
|
1875
1940
|
});
|
|
1876
1941
|
MaterialDynamicColors.tertiaryFixedDim = DynamicColor.fromPalette({
|
|
@@ -1879,7 +1944,7 @@ MaterialDynamicColors.tertiaryFixedDim = DynamicColor.fromPalette({
|
|
|
1879
1944
|
tone: (s) => isMonochrome(s) ? 30 : 80,
|
|
1880
1945
|
isBackground: true,
|
|
1881
1946
|
background: (s) => MaterialDynamicColors.highestSurface(s),
|
|
1882
|
-
contrastCurve: new ContrastCurve(1, 1, 3,
|
|
1947
|
+
contrastCurve: new ContrastCurve(1, 1, 3, 4.5),
|
|
1883
1948
|
toneDeltaPair: (s) => new ToneDeltaPair(MaterialDynamicColors.tertiaryFixed, MaterialDynamicColors.tertiaryFixedDim, 10, "lighter", true)
|
|
1884
1949
|
});
|
|
1885
1950
|
MaterialDynamicColors.onTertiaryFixed = DynamicColor.fromPalette({
|
|
@@ -1899,61 +1964,7 @@ MaterialDynamicColors.onTertiaryFixedVariant = DynamicColor.fromPalette({
|
|
|
1899
1964
|
contrastCurve: new ContrastCurve(3, 4.5, 7, 11)
|
|
1900
1965
|
});
|
|
1901
1966
|
|
|
1902
|
-
// node_modules/@material/material-color-utilities/
|
|
1903
|
-
var TonalPalette = class {
|
|
1904
|
-
static fromInt(argb) {
|
|
1905
|
-
const hct = Hct.fromInt(argb);
|
|
1906
|
-
return TonalPalette.fromHct(hct);
|
|
1907
|
-
}
|
|
1908
|
-
static fromHct(hct) {
|
|
1909
|
-
return new TonalPalette(hct.hue, hct.chroma, hct);
|
|
1910
|
-
}
|
|
1911
|
-
static fromHueAndChroma(hue, chroma) {
|
|
1912
|
-
return new TonalPalette(hue, chroma, TonalPalette.createKeyColor(hue, chroma));
|
|
1913
|
-
}
|
|
1914
|
-
constructor(hue, chroma, keyColor) {
|
|
1915
|
-
this.hue = hue;
|
|
1916
|
-
this.chroma = chroma;
|
|
1917
|
-
this.keyColor = keyColor;
|
|
1918
|
-
this.cache = /* @__PURE__ */ new Map();
|
|
1919
|
-
}
|
|
1920
|
-
static createKeyColor(hue, chroma) {
|
|
1921
|
-
const startTone = 50;
|
|
1922
|
-
let smallestDeltaHct = Hct.from(hue, chroma, startTone);
|
|
1923
|
-
let smallestDelta = Math.abs(smallestDeltaHct.chroma - chroma);
|
|
1924
|
-
for (let delta = 1; delta < 50; delta += 1) {
|
|
1925
|
-
if (Math.round(chroma) === Math.round(smallestDeltaHct.chroma)) {
|
|
1926
|
-
return smallestDeltaHct;
|
|
1927
|
-
}
|
|
1928
|
-
const hctAdd = Hct.from(hue, chroma, startTone + delta);
|
|
1929
|
-
const hctAddDelta = Math.abs(hctAdd.chroma - chroma);
|
|
1930
|
-
if (hctAddDelta < smallestDelta) {
|
|
1931
|
-
smallestDelta = hctAddDelta;
|
|
1932
|
-
smallestDeltaHct = hctAdd;
|
|
1933
|
-
}
|
|
1934
|
-
const hctSubtract = Hct.from(hue, chroma, startTone - delta);
|
|
1935
|
-
const hctSubtractDelta = Math.abs(hctSubtract.chroma - chroma);
|
|
1936
|
-
if (hctSubtractDelta < smallestDelta) {
|
|
1937
|
-
smallestDelta = hctSubtractDelta;
|
|
1938
|
-
smallestDeltaHct = hctSubtract;
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
return smallestDeltaHct;
|
|
1942
|
-
}
|
|
1943
|
-
tone(tone) {
|
|
1944
|
-
let argb = this.cache.get(tone);
|
|
1945
|
-
if (argb === void 0) {
|
|
1946
|
-
argb = Hct.from(this.hue, this.chroma, tone).toInt();
|
|
1947
|
-
this.cache.set(tone, argb);
|
|
1948
|
-
}
|
|
1949
|
-
return argb;
|
|
1950
|
-
}
|
|
1951
|
-
getHct(tone) {
|
|
1952
|
-
return Hct.fromInt(this.tone(tone));
|
|
1953
|
-
}
|
|
1954
|
-
};
|
|
1955
|
-
|
|
1956
|
-
// node_modules/@material/material-color-utilities/scheme/dynamic_scheme.js
|
|
1967
|
+
// node_modules/@material/material-color-utilities/dynamiccolor/dynamic_scheme.js
|
|
1957
1968
|
var DynamicScheme = class {
|
|
1958
1969
|
constructor(args) {
|
|
1959
1970
|
this.sourceColorArgb = args.sourceColorArgb;
|
|
@@ -1986,6 +1997,174 @@ var DynamicScheme = class {
|
|
|
1986
1997
|
}
|
|
1987
1998
|
return sourceHue;
|
|
1988
1999
|
}
|
|
2000
|
+
getArgb(dynamicColor) {
|
|
2001
|
+
return dynamicColor.getArgb(this);
|
|
2002
|
+
}
|
|
2003
|
+
getHct(dynamicColor) {
|
|
2004
|
+
return dynamicColor.getHct(this);
|
|
2005
|
+
}
|
|
2006
|
+
get primaryPaletteKeyColor() {
|
|
2007
|
+
return this.getArgb(MaterialDynamicColors.primaryPaletteKeyColor);
|
|
2008
|
+
}
|
|
2009
|
+
get secondaryPaletteKeyColor() {
|
|
2010
|
+
return this.getArgb(MaterialDynamicColors.secondaryPaletteKeyColor);
|
|
2011
|
+
}
|
|
2012
|
+
get tertiaryPaletteKeyColor() {
|
|
2013
|
+
return this.getArgb(MaterialDynamicColors.tertiaryPaletteKeyColor);
|
|
2014
|
+
}
|
|
2015
|
+
get neutralPaletteKeyColor() {
|
|
2016
|
+
return this.getArgb(MaterialDynamicColors.neutralPaletteKeyColor);
|
|
2017
|
+
}
|
|
2018
|
+
get neutralVariantPaletteKeyColor() {
|
|
2019
|
+
return this.getArgb(MaterialDynamicColors.neutralVariantPaletteKeyColor);
|
|
2020
|
+
}
|
|
2021
|
+
get background() {
|
|
2022
|
+
return this.getArgb(MaterialDynamicColors.background);
|
|
2023
|
+
}
|
|
2024
|
+
get onBackground() {
|
|
2025
|
+
return this.getArgb(MaterialDynamicColors.onBackground);
|
|
2026
|
+
}
|
|
2027
|
+
get surface() {
|
|
2028
|
+
return this.getArgb(MaterialDynamicColors.surface);
|
|
2029
|
+
}
|
|
2030
|
+
get surfaceDim() {
|
|
2031
|
+
return this.getArgb(MaterialDynamicColors.surfaceDim);
|
|
2032
|
+
}
|
|
2033
|
+
get surfaceBright() {
|
|
2034
|
+
return this.getArgb(MaterialDynamicColors.surfaceBright);
|
|
2035
|
+
}
|
|
2036
|
+
get surfaceContainerLowest() {
|
|
2037
|
+
return this.getArgb(MaterialDynamicColors.surfaceContainerLowest);
|
|
2038
|
+
}
|
|
2039
|
+
get surfaceContainerLow() {
|
|
2040
|
+
return this.getArgb(MaterialDynamicColors.surfaceContainerLow);
|
|
2041
|
+
}
|
|
2042
|
+
get surfaceContainer() {
|
|
2043
|
+
return this.getArgb(MaterialDynamicColors.surfaceContainer);
|
|
2044
|
+
}
|
|
2045
|
+
get surfaceContainerHigh() {
|
|
2046
|
+
return this.getArgb(MaterialDynamicColors.surfaceContainerHigh);
|
|
2047
|
+
}
|
|
2048
|
+
get surfaceContainerHighest() {
|
|
2049
|
+
return this.getArgb(MaterialDynamicColors.surfaceContainerHighest);
|
|
2050
|
+
}
|
|
2051
|
+
get onSurface() {
|
|
2052
|
+
return this.getArgb(MaterialDynamicColors.onSurface);
|
|
2053
|
+
}
|
|
2054
|
+
get surfaceVariant() {
|
|
2055
|
+
return this.getArgb(MaterialDynamicColors.surfaceVariant);
|
|
2056
|
+
}
|
|
2057
|
+
get onSurfaceVariant() {
|
|
2058
|
+
return this.getArgb(MaterialDynamicColors.onSurfaceVariant);
|
|
2059
|
+
}
|
|
2060
|
+
get inverseSurface() {
|
|
2061
|
+
return this.getArgb(MaterialDynamicColors.inverseSurface);
|
|
2062
|
+
}
|
|
2063
|
+
get inverseOnSurface() {
|
|
2064
|
+
return this.getArgb(MaterialDynamicColors.inverseOnSurface);
|
|
2065
|
+
}
|
|
2066
|
+
get outline() {
|
|
2067
|
+
return this.getArgb(MaterialDynamicColors.outline);
|
|
2068
|
+
}
|
|
2069
|
+
get outlineVariant() {
|
|
2070
|
+
return this.getArgb(MaterialDynamicColors.outlineVariant);
|
|
2071
|
+
}
|
|
2072
|
+
get shadow() {
|
|
2073
|
+
return this.getArgb(MaterialDynamicColors.shadow);
|
|
2074
|
+
}
|
|
2075
|
+
get scrim() {
|
|
2076
|
+
return this.getArgb(MaterialDynamicColors.scrim);
|
|
2077
|
+
}
|
|
2078
|
+
get surfaceTint() {
|
|
2079
|
+
return this.getArgb(MaterialDynamicColors.surfaceTint);
|
|
2080
|
+
}
|
|
2081
|
+
get primary() {
|
|
2082
|
+
return this.getArgb(MaterialDynamicColors.primary);
|
|
2083
|
+
}
|
|
2084
|
+
get onPrimary() {
|
|
2085
|
+
return this.getArgb(MaterialDynamicColors.onPrimary);
|
|
2086
|
+
}
|
|
2087
|
+
get primaryContainer() {
|
|
2088
|
+
return this.getArgb(MaterialDynamicColors.primaryContainer);
|
|
2089
|
+
}
|
|
2090
|
+
get onPrimaryContainer() {
|
|
2091
|
+
return this.getArgb(MaterialDynamicColors.onPrimaryContainer);
|
|
2092
|
+
}
|
|
2093
|
+
get inversePrimary() {
|
|
2094
|
+
return this.getArgb(MaterialDynamicColors.inversePrimary);
|
|
2095
|
+
}
|
|
2096
|
+
get secondary() {
|
|
2097
|
+
return this.getArgb(MaterialDynamicColors.secondary);
|
|
2098
|
+
}
|
|
2099
|
+
get onSecondary() {
|
|
2100
|
+
return this.getArgb(MaterialDynamicColors.onSecondary);
|
|
2101
|
+
}
|
|
2102
|
+
get secondaryContainer() {
|
|
2103
|
+
return this.getArgb(MaterialDynamicColors.secondaryContainer);
|
|
2104
|
+
}
|
|
2105
|
+
get onSecondaryContainer() {
|
|
2106
|
+
return this.getArgb(MaterialDynamicColors.onSecondaryContainer);
|
|
2107
|
+
}
|
|
2108
|
+
get tertiary() {
|
|
2109
|
+
return this.getArgb(MaterialDynamicColors.tertiary);
|
|
2110
|
+
}
|
|
2111
|
+
get onTertiary() {
|
|
2112
|
+
return this.getArgb(MaterialDynamicColors.onTertiary);
|
|
2113
|
+
}
|
|
2114
|
+
get tertiaryContainer() {
|
|
2115
|
+
return this.getArgb(MaterialDynamicColors.tertiaryContainer);
|
|
2116
|
+
}
|
|
2117
|
+
get onTertiaryContainer() {
|
|
2118
|
+
return this.getArgb(MaterialDynamicColors.onTertiaryContainer);
|
|
2119
|
+
}
|
|
2120
|
+
get error() {
|
|
2121
|
+
return this.getArgb(MaterialDynamicColors.error);
|
|
2122
|
+
}
|
|
2123
|
+
get onError() {
|
|
2124
|
+
return this.getArgb(MaterialDynamicColors.onError);
|
|
2125
|
+
}
|
|
2126
|
+
get errorContainer() {
|
|
2127
|
+
return this.getArgb(MaterialDynamicColors.errorContainer);
|
|
2128
|
+
}
|
|
2129
|
+
get onErrorContainer() {
|
|
2130
|
+
return this.getArgb(MaterialDynamicColors.onErrorContainer);
|
|
2131
|
+
}
|
|
2132
|
+
get primaryFixed() {
|
|
2133
|
+
return this.getArgb(MaterialDynamicColors.primaryFixed);
|
|
2134
|
+
}
|
|
2135
|
+
get primaryFixedDim() {
|
|
2136
|
+
return this.getArgb(MaterialDynamicColors.primaryFixedDim);
|
|
2137
|
+
}
|
|
2138
|
+
get onPrimaryFixed() {
|
|
2139
|
+
return this.getArgb(MaterialDynamicColors.onPrimaryFixed);
|
|
2140
|
+
}
|
|
2141
|
+
get onPrimaryFixedVariant() {
|
|
2142
|
+
return this.getArgb(MaterialDynamicColors.onPrimaryFixedVariant);
|
|
2143
|
+
}
|
|
2144
|
+
get secondaryFixed() {
|
|
2145
|
+
return this.getArgb(MaterialDynamicColors.secondaryFixed);
|
|
2146
|
+
}
|
|
2147
|
+
get secondaryFixedDim() {
|
|
2148
|
+
return this.getArgb(MaterialDynamicColors.secondaryFixedDim);
|
|
2149
|
+
}
|
|
2150
|
+
get onSecondaryFixed() {
|
|
2151
|
+
return this.getArgb(MaterialDynamicColors.onSecondaryFixed);
|
|
2152
|
+
}
|
|
2153
|
+
get onSecondaryFixedVariant() {
|
|
2154
|
+
return this.getArgb(MaterialDynamicColors.onSecondaryFixedVariant);
|
|
2155
|
+
}
|
|
2156
|
+
get tertiaryFixed() {
|
|
2157
|
+
return this.getArgb(MaterialDynamicColors.tertiaryFixed);
|
|
2158
|
+
}
|
|
2159
|
+
get tertiaryFixedDim() {
|
|
2160
|
+
return this.getArgb(MaterialDynamicColors.tertiaryFixedDim);
|
|
2161
|
+
}
|
|
2162
|
+
get onTertiaryFixed() {
|
|
2163
|
+
return this.getArgb(MaterialDynamicColors.onTertiaryFixed);
|
|
2164
|
+
}
|
|
2165
|
+
get onTertiaryFixedVariant() {
|
|
2166
|
+
return this.getArgb(MaterialDynamicColors.onTertiaryFixedVariant);
|
|
2167
|
+
}
|
|
1989
2168
|
};
|
|
1990
2169
|
|
|
1991
2170
|
// node_modules/@material/material-color-utilities/temperature/temperature_cache.js
|
|
@@ -2167,23 +2346,6 @@ var TemperatureCache = class {
|
|
|
2167
2346
|
}
|
|
2168
2347
|
};
|
|
2169
2348
|
|
|
2170
|
-
// node_modules/@material/material-color-utilities/scheme/scheme_content.js
|
|
2171
|
-
var SchemeContent = class extends DynamicScheme {
|
|
2172
|
-
constructor(sourceColorHct, isDark, contrastLevel) {
|
|
2173
|
-
super({
|
|
2174
|
-
sourceColorArgb: sourceColorHct.toInt(),
|
|
2175
|
-
variant: Variant.CONTENT,
|
|
2176
|
-
contrastLevel,
|
|
2177
|
-
isDark,
|
|
2178
|
-
primaryPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma),
|
|
2179
|
-
secondaryPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, Math.max(sourceColorHct.chroma - 32, sourceColorHct.chroma * 0.5)),
|
|
2180
|
-
tertiaryPalette: TonalPalette.fromInt(DislikeAnalyzer.fixIfDisliked(new TemperatureCache(sourceColorHct).analogous(3, 6)[2]).toInt()),
|
|
2181
|
-
neutralPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma / 8),
|
|
2182
|
-
neutralVariantPalette: TonalPalette.fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma / 8 + 4)
|
|
2183
|
-
});
|
|
2184
|
-
}
|
|
2185
|
-
};
|
|
2186
|
-
|
|
2187
2349
|
// node_modules/@material/material-color-utilities/scheme/scheme_expressive.js
|
|
2188
2350
|
var SchemeExpressive = class extends DynamicScheme {
|
|
2189
2351
|
constructor(sourceColorHct, isDark, contrastLevel) {
|
|
@@ -2411,7 +2573,7 @@ function parseIntHex(value) {
|
|
|
2411
2573
|
return parseInt(value, 16);
|
|
2412
2574
|
}
|
|
2413
2575
|
|
|
2414
|
-
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/
|
|
2576
|
+
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/theme-color/index.mjs
|
|
2415
2577
|
var HUE_TONES = [0, 10, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100];
|
|
2416
2578
|
var NEUTRAL_HUES = /* @__PURE__ */ new Map([
|
|
2417
2579
|
[4, { prev: 0, next: 10 }],
|
|
@@ -2426,40 +2588,18 @@ var NEUTRAL_HUES = /* @__PURE__ */ new Map([
|
|
|
2426
2588
|
[96, { prev: 95, next: 98 }]
|
|
2427
2589
|
]);
|
|
2428
2590
|
var NEUTRAL_HUE_TONES = [...HUE_TONES, ...NEUTRAL_HUES.keys()];
|
|
2429
|
-
function
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
neutral: scheme.neutralPalette,
|
|
2442
|
-
neutralVariant: scheme.neutralVariantPalette,
|
|
2443
|
-
error: scheme.errorPalette
|
|
2444
|
-
};
|
|
2445
|
-
} catch (e) {
|
|
2446
|
-
throw new Error("Cannot parse the specified color " + color + ". Please verify it is a hex color (ex. #ffffff or ffffff).");
|
|
2447
|
-
}
|
|
2448
|
-
}
|
|
2449
|
-
function getColorTonalPalettes(color) {
|
|
2450
|
-
const tonalPalettes = getMaterialTonalPalettes(color);
|
|
2451
|
-
const palettes = /* @__PURE__ */ new Map();
|
|
2452
|
-
for (const [key, palette] of Object.entries(tonalPalettes)) {
|
|
2453
|
-
const paletteKey = key.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2454
|
-
const tones = paletteKey === "neutral" ? NEUTRAL_HUE_TONES : HUE_TONES;
|
|
2455
|
-
const colorPalette = /* @__PURE__ */ new Map();
|
|
2456
|
-
for (const tone of tones) {
|
|
2457
|
-
const color2 = hexFromArgb(palette.tone(tone));
|
|
2458
|
-
colorPalette.set(tone, color2);
|
|
2459
|
-
}
|
|
2460
|
-
palettes.set(paletteKey, colorPalette);
|
|
2461
|
-
}
|
|
2462
|
-
return palettes;
|
|
2591
|
+
function getMaterialDynamicScheme(primaryPalette, secondaryPalette, tertiaryPalette, neutralPalette, neutralVariantPalette, isDark, contrastLevel) {
|
|
2592
|
+
return new DynamicScheme({
|
|
2593
|
+
sourceColorArgb: primaryPalette.keyColor.toInt(),
|
|
2594
|
+
variant: 6,
|
|
2595
|
+
contrastLevel,
|
|
2596
|
+
isDark,
|
|
2597
|
+
primaryPalette,
|
|
2598
|
+
secondaryPalette,
|
|
2599
|
+
tertiaryPalette,
|
|
2600
|
+
neutralPalette,
|
|
2601
|
+
neutralVariantPalette
|
|
2602
|
+
});
|
|
2463
2603
|
}
|
|
2464
2604
|
function getColorPalettesSCSS(colorPalettes) {
|
|
2465
2605
|
let scss = "(\n";
|
|
@@ -2473,16 +2613,38 @@ function getColorPalettesSCSS(colorPalettes) {
|
|
|
2473
2613
|
scss += ");";
|
|
2474
2614
|
return scss;
|
|
2475
2615
|
}
|
|
2476
|
-
function
|
|
2616
|
+
function getMapFromColorTonalPalettes(primaryPalette, secondaryPalette, tertiaryPalette, neutralPalette, neutralVariantPalette, errorPalette) {
|
|
2617
|
+
const tonalPalettes = {
|
|
2618
|
+
primary: primaryPalette,
|
|
2619
|
+
secondary: secondaryPalette,
|
|
2620
|
+
tertiary: tertiaryPalette,
|
|
2621
|
+
neutral: neutralPalette,
|
|
2622
|
+
neutralVariant: neutralVariantPalette,
|
|
2623
|
+
error: errorPalette
|
|
2624
|
+
};
|
|
2625
|
+
const palettes = /* @__PURE__ */ new Map();
|
|
2626
|
+
for (const [key, palette] of Object.entries(tonalPalettes)) {
|
|
2627
|
+
const paletteKey = key.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2628
|
+
const tones = paletteKey === "neutral" ? NEUTRAL_HUE_TONES : HUE_TONES;
|
|
2629
|
+
const colorPalette = /* @__PURE__ */ new Map();
|
|
2630
|
+
for (const tone of tones) {
|
|
2631
|
+
const color = hexFromArgb(palette.tone(tone));
|
|
2632
|
+
colorPalette.set(tone, color);
|
|
2633
|
+
}
|
|
2634
|
+
palettes.set(paletteKey, colorPalette);
|
|
2635
|
+
}
|
|
2636
|
+
return palettes;
|
|
2637
|
+
}
|
|
2638
|
+
function generateSCSSTheme(colorPalettes, colorComment) {
|
|
2477
2639
|
let scss = [
|
|
2478
|
-
"// This file was generated by running 'ng generate @angular/material:
|
|
2640
|
+
"// This file was generated by running 'ng generate @angular/material:theme-color'.",
|
|
2479
2641
|
"// Proceed with caution if making changes to this file.",
|
|
2480
2642
|
"",
|
|
2481
2643
|
"@use 'sass:map';",
|
|
2482
2644
|
"@use '@angular/material' as mat;",
|
|
2483
2645
|
"",
|
|
2484
2646
|
"// Note: " + colorComment,
|
|
2485
|
-
"$_palettes: " + getColorPalettesSCSS(
|
|
2647
|
+
"$_palettes: " + getColorPalettesSCSS(colorPalettes),
|
|
2486
2648
|
"",
|
|
2487
2649
|
"$_rest: (",
|
|
2488
2650
|
" secondary: map.get($_palettes, secondary),",
|
|
@@ -2490,121 +2652,151 @@ function generateSCSSTheme(colorPalettes, themeTypes, colorComment, useSystemVar
|
|
|
2490
2652
|
" neutral-variant: map.get($_palettes, neutral-variant),",
|
|
2491
2653
|
" error: map.get($_palettes, error),",
|
|
2492
2654
|
");",
|
|
2493
|
-
"
|
|
2494
|
-
"$
|
|
2495
|
-
""
|
|
2655
|
+
"",
|
|
2656
|
+
"$primary-palette: map.merge(map.get($_palettes, primary), $_rest);",
|
|
2657
|
+
"$tertiary-palette: map.merge(map.get($_palettes, tertiary), $_rest);"
|
|
2496
2658
|
];
|
|
2497
|
-
let themes = themeTypes === "both" ? ["light", "dark"] : [themeTypes];
|
|
2498
|
-
for (const themeType of themes) {
|
|
2499
|
-
scss = scss.concat([
|
|
2500
|
-
"$" + themeType + "-theme: mat.define-theme((",
|
|
2501
|
-
" color: (",
|
|
2502
|
-
" theme-type: " + themeType + ",",
|
|
2503
|
-
" primary: $_primary,",
|
|
2504
|
-
" tertiary: $_tertiary,",
|
|
2505
|
-
...useSystemVariables ? [" use-system-variables: true,"] : [],
|
|
2506
|
-
" ),",
|
|
2507
|
-
...useSystemVariables ? [" typography: (", " use-system-variables: true,", " ),"] : [],
|
|
2508
|
-
"));"
|
|
2509
|
-
]);
|
|
2510
|
-
}
|
|
2511
2659
|
return scss.join("\n");
|
|
2512
2660
|
}
|
|
2661
|
+
function getHighContrastOverides(primaryPalette, secondaryPalette, tertiaryPalette, neutralPalette, neutralVariantPalette, isDark) {
|
|
2662
|
+
const scheme = getMaterialDynamicScheme(primaryPalette, secondaryPalette, tertiaryPalette, neutralPalette, neutralVariantPalette, isDark, 1);
|
|
2663
|
+
const overrides = /* @__PURE__ */ new Map();
|
|
2664
|
+
overrides.set("primary", hexFromArgb(scheme.primary));
|
|
2665
|
+
overrides.set("on-primary", hexFromArgb(scheme.onPrimary));
|
|
2666
|
+
overrides.set("primary-container", hexFromArgb(scheme.primaryContainer));
|
|
2667
|
+
overrides.set("on-primary-container", hexFromArgb(scheme.onPrimaryContainer));
|
|
2668
|
+
overrides.set("inverse-primary", hexFromArgb(scheme.inversePrimary));
|
|
2669
|
+
overrides.set("primary-fixed", hexFromArgb(scheme.primaryFixed));
|
|
2670
|
+
overrides.set("primary-fixed-dim", hexFromArgb(scheme.primaryFixedDim));
|
|
2671
|
+
overrides.set("on-primary-fixed", hexFromArgb(scheme.onPrimaryFixed));
|
|
2672
|
+
overrides.set("on-primary-fixed-variant", hexFromArgb(scheme.onPrimaryFixedVariant));
|
|
2673
|
+
overrides.set("secondary", hexFromArgb(scheme.secondary));
|
|
2674
|
+
overrides.set("on-secondary", hexFromArgb(scheme.onSecondary));
|
|
2675
|
+
overrides.set("secondary-container", hexFromArgb(scheme.secondaryContainer));
|
|
2676
|
+
overrides.set("on-secondary-container", hexFromArgb(scheme.onSecondaryContainer));
|
|
2677
|
+
overrides.set("secondary-fixed", hexFromArgb(scheme.secondaryFixed));
|
|
2678
|
+
overrides.set("secondary-fixed-dim", hexFromArgb(scheme.secondaryFixedDim));
|
|
2679
|
+
overrides.set("on-secondary-fixed", hexFromArgb(scheme.onSecondaryFixed));
|
|
2680
|
+
overrides.set("on-secondary-fixed-variant", hexFromArgb(scheme.onSecondaryFixedVariant));
|
|
2681
|
+
overrides.set("tertiary", hexFromArgb(scheme.tertiary));
|
|
2682
|
+
overrides.set("on-tertiary", hexFromArgb(scheme.onTertiary));
|
|
2683
|
+
overrides.set("tertiary-container", hexFromArgb(scheme.tertiaryContainer));
|
|
2684
|
+
overrides.set("on-tertiary-container", hexFromArgb(scheme.onTertiaryContainer));
|
|
2685
|
+
overrides.set("tertiary-fixed", hexFromArgb(scheme.tertiaryFixed));
|
|
2686
|
+
overrides.set("tertiary-fixed-dim", hexFromArgb(scheme.tertiaryFixedDim));
|
|
2687
|
+
overrides.set("on-tertiary-fixed", hexFromArgb(scheme.onTertiaryFixed));
|
|
2688
|
+
overrides.set("on-tertiary-fixed-variant", hexFromArgb(scheme.onTertiaryFixedVariant));
|
|
2689
|
+
overrides.set("background", hexFromArgb(scheme.background));
|
|
2690
|
+
overrides.set("on-background", hexFromArgb(scheme.onBackground));
|
|
2691
|
+
overrides.set("surface", hexFromArgb(scheme.surface));
|
|
2692
|
+
overrides.set("surface-dim", hexFromArgb(scheme.surfaceDim));
|
|
2693
|
+
overrides.set("surface-bright", hexFromArgb(scheme.surfaceBright));
|
|
2694
|
+
overrides.set("surface-container-lowest", hexFromArgb(scheme.surfaceContainerLowest));
|
|
2695
|
+
overrides.set("surface-container", hexFromArgb(scheme.surfaceContainer));
|
|
2696
|
+
overrides.set("surface-container-high", hexFromArgb(scheme.surfaceContainerHigh));
|
|
2697
|
+
overrides.set("surface-container-highest", hexFromArgb(scheme.surfaceContainerHighest));
|
|
2698
|
+
overrides.set("on-surface", hexFromArgb(scheme.onSurface));
|
|
2699
|
+
overrides.set("shadow", hexFromArgb(scheme.shadow));
|
|
2700
|
+
overrides.set("scrim", hexFromArgb(scheme.scrim));
|
|
2701
|
+
overrides.set("surface-tint", hexFromArgb(scheme.surfaceTint));
|
|
2702
|
+
overrides.set("inverse-surface", hexFromArgb(scheme.inverseSurface));
|
|
2703
|
+
overrides.set("inverse-on-surface", hexFromArgb(scheme.inverseOnSurface));
|
|
2704
|
+
overrides.set("outline", hexFromArgb(scheme.outline));
|
|
2705
|
+
overrides.set("outline-variant", hexFromArgb(scheme.outlineVariant));
|
|
2706
|
+
overrides.set("error", hexFromArgb(scheme.error));
|
|
2707
|
+
overrides.set("on-error", hexFromArgb(scheme.onError));
|
|
2708
|
+
overrides.set("error-container", hexFromArgb(scheme.errorContainer));
|
|
2709
|
+
overrides.set("on-error-container", hexFromArgb(scheme.onErrorContainer));
|
|
2710
|
+
overrides.set("surface-variant", hexFromArgb(scheme.surfaceVariant));
|
|
2711
|
+
overrides.set("on-surface-variant", hexFromArgb(scheme.onSurfaceVariant));
|
|
2712
|
+
return overrides;
|
|
2713
|
+
}
|
|
2714
|
+
function generateHighContrastOverrideMixinsSCSS(primaryPalette, secondaryPalette, tertiaryPalette, neutralPalette, neutralVariantPalette) {
|
|
2715
|
+
const lightOverrides = getHighContrastOverides(
|
|
2716
|
+
primaryPalette,
|
|
2717
|
+
secondaryPalette,
|
|
2718
|
+
tertiaryPalette,
|
|
2719
|
+
neutralPalette,
|
|
2720
|
+
neutralVariantPalette,
|
|
2721
|
+
false
|
|
2722
|
+
);
|
|
2723
|
+
const darkOverrides = getHighContrastOverides(
|
|
2724
|
+
primaryPalette,
|
|
2725
|
+
secondaryPalette,
|
|
2726
|
+
tertiaryPalette,
|
|
2727
|
+
neutralPalette,
|
|
2728
|
+
neutralVariantPalette,
|
|
2729
|
+
true
|
|
2730
|
+
);
|
|
2731
|
+
let scss = "\n";
|
|
2732
|
+
scss += "\n@function _high-contrast-value($light, $dark, $theme-type) {\n";
|
|
2733
|
+
scss += " @if ($theme-type == light) {\n";
|
|
2734
|
+
scss += " @return $light;\n";
|
|
2735
|
+
scss += " }\n";
|
|
2736
|
+
scss += " @if ($theme-type == dark) {\n";
|
|
2737
|
+
scss += " @return $dark;\n";
|
|
2738
|
+
scss += " }\n";
|
|
2739
|
+
scss += " @if ($theme-type == color-scheme) {\n";
|
|
2740
|
+
scss += " @return light-dark(#{$light}, #{$dark});\n";
|
|
2741
|
+
scss += " }\n";
|
|
2742
|
+
scss += " \n @error 'Unknown theme-type #{$theme-type}. Expected light, dark, or color-scheme';\n";
|
|
2743
|
+
scss += "}\n";
|
|
2744
|
+
scss += "\n@mixin high-contrast-overrides($theme-type) {\n";
|
|
2745
|
+
scss += " @include mat.theme-overrides((\n";
|
|
2746
|
+
for (const [key, value] of lightOverrides.entries()) {
|
|
2747
|
+
scss += " " + key + ": _high-contrast-value(" + value + ", " + darkOverrides.get(key) + ", $theme-type),\n";
|
|
2748
|
+
}
|
|
2749
|
+
scss += " ))\n";
|
|
2750
|
+
scss += " }\n";
|
|
2751
|
+
return scss;
|
|
2752
|
+
}
|
|
2753
|
+
function getHctFromHex(color) {
|
|
2754
|
+
try {
|
|
2755
|
+
return Hct.fromInt(argbFromHex(color));
|
|
2756
|
+
} catch (e) {
|
|
2757
|
+
throw new Error("Cannot parse the specified color " + color + ". Please verify it is a hex color (ex. #ffffff or ffffff).");
|
|
2758
|
+
}
|
|
2759
|
+
}
|
|
2513
2760
|
function createThemeFile(scss, tree, directory) {
|
|
2514
|
-
const filePath = directory ? directory + "
|
|
2761
|
+
const filePath = directory ? directory + "_theme-colors.scss" : "_theme-colors.scss";
|
|
2515
2762
|
tree.create(filePath, scss);
|
|
2516
2763
|
}
|
|
2517
|
-
function
|
|
2764
|
+
function theme_color_default(options) {
|
|
2518
2765
|
return (tree, context) => __async(this, null, function* () {
|
|
2519
|
-
const colorPalettes = getColorTonalPalettes(options.primaryColor);
|
|
2520
2766
|
let colorComment = "Color palettes are generated from primary: " + options.primaryColor;
|
|
2767
|
+
const primaryColorHct = getHctFromHex(options.primaryColor);
|
|
2768
|
+
const primaryPalette = TonalPalette.fromHct(primaryColorHct);
|
|
2769
|
+
let secondaryPalette;
|
|
2521
2770
|
if (options.secondaryColor) {
|
|
2522
|
-
colorPalettes.set("secondary", getColorTonalPalettes(options.secondaryColor).get("primary"));
|
|
2523
2771
|
colorComment += ", secondary: " + options.secondaryColor;
|
|
2772
|
+
secondaryPalette = TonalPalette.fromHct(getHctFromHex(options.secondaryColor));
|
|
2773
|
+
} else {
|
|
2774
|
+
secondaryPalette = TonalPalette.fromHueAndChroma(primaryColorHct.hue, Math.max(primaryColorHct.chroma - 32, primaryColorHct.chroma * 0.5));
|
|
2524
2775
|
}
|
|
2776
|
+
let tertiaryPalette;
|
|
2525
2777
|
if (options.tertiaryColor) {
|
|
2526
|
-
colorPalettes.set("tertiary", getColorTonalPalettes(options.tertiaryColor).get("primary"));
|
|
2527
2778
|
colorComment += ", tertiary: " + options.tertiaryColor;
|
|
2779
|
+
tertiaryPalette = TonalPalette.fromHct(getHctFromHex(options.tertiaryColor));
|
|
2780
|
+
} else {
|
|
2781
|
+
tertiaryPalette = TonalPalette.fromInt(DislikeAnalyzer.fixIfDisliked(new TemperatureCache(primaryColorHct).analogous(3, 6)[2]).toInt());
|
|
2528
2782
|
}
|
|
2783
|
+
let neutralPalette;
|
|
2529
2784
|
if (options.neutralColor) {
|
|
2530
|
-
colorPalettes.set("neutral", getColorTonalPalettes(options.neutralColor).get("primary"));
|
|
2531
2785
|
colorComment += ", neutral: " + options.neutralColor;
|
|
2786
|
+
neutralPalette = TonalPalette.fromHct(getHctFromHex(options.neutralColor));
|
|
2787
|
+
} else {
|
|
2788
|
+
neutralPalette = TonalPalette.fromHueAndChroma(primaryColorHct.hue, primaryColorHct.chroma / 8);
|
|
2532
2789
|
}
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2790
|
+
const neutralVariantPalette = TonalPalette.fromHueAndChroma(primaryColorHct.hue, primaryColorHct.chroma / 8 + 4);
|
|
2791
|
+
const errorPalette = getMaterialDynamicScheme(primaryPalette, secondaryPalette, tertiaryPalette, neutralPalette, neutralVariantPalette, false, 0).errorPalette;
|
|
2792
|
+
const colorPalettes = getMapFromColorTonalPalettes(primaryPalette, secondaryPalette, tertiaryPalette, neutralPalette, neutralVariantPalette, errorPalette);
|
|
2793
|
+
let themeScss = generateSCSSTheme(colorPalettes, colorComment);
|
|
2794
|
+
if (options.includeHighContrast) {
|
|
2795
|
+
themeScss += generateHighContrastOverrideMixinsSCSS(primaryPalette, secondaryPalette, tertiaryPalette, neutralPalette, neutralVariantPalette);
|
|
2536
2796
|
}
|
|
2537
|
-
const themeScss = generateSCSSTheme(colorPalettes, options.themeTypes, colorComment, options.useSystemVariables || false);
|
|
2538
2797
|
createThemeFile(themeScss, tree, options.directory);
|
|
2539
2798
|
});
|
|
2540
2799
|
}
|
|
2541
|
-
function patchMissingHues(palettes) {
|
|
2542
|
-
const neutral = palettes.get("neutral");
|
|
2543
|
-
if (!neutral) {
|
|
2544
|
-
return palettes;
|
|
2545
|
-
}
|
|
2546
|
-
let newNeutral = null;
|
|
2547
|
-
for (const [hue, { prev, next }] of NEUTRAL_HUES) {
|
|
2548
|
-
if (!neutral.has(hue) && neutral.has(prev) && neutral.has(next)) {
|
|
2549
|
-
const weight = (next - hue) / (next - prev);
|
|
2550
|
-
const result = mixColors(neutral.get(prev), neutral.get(next), weight);
|
|
2551
|
-
if (result !== null) {
|
|
2552
|
-
newNeutral != null ? newNeutral : newNeutral = new Map(neutral.entries());
|
|
2553
|
-
newNeutral.set(hue, result);
|
|
2554
|
-
}
|
|
2555
|
-
}
|
|
2556
|
-
}
|
|
2557
|
-
if (!newNeutral) {
|
|
2558
|
-
return palettes;
|
|
2559
|
-
}
|
|
2560
|
-
const newPalettes = /* @__PURE__ */ new Map();
|
|
2561
|
-
for (const [key, value] of palettes) {
|
|
2562
|
-
if (key === "neutral") {
|
|
2563
|
-
const sortedNeutral = Array.from(newNeutral.keys()).sort((a, b) => a - b).reduce((newHues, key2) => {
|
|
2564
|
-
newHues.set(key2, newNeutral.get(key2));
|
|
2565
|
-
return newHues;
|
|
2566
|
-
}, /* @__PURE__ */ new Map());
|
|
2567
|
-
newPalettes.set(key, sortedNeutral);
|
|
2568
|
-
} else {
|
|
2569
|
-
newPalettes.set(key, value);
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
|
-
return newPalettes;
|
|
2573
|
-
}
|
|
2574
|
-
function mixColors(c1, c2, weight) {
|
|
2575
|
-
const normalizedWeight = weight * 2 - 1;
|
|
2576
|
-
const weight1 = (normalizedWeight + 1) / 2;
|
|
2577
|
-
const weight2 = 1 - weight1;
|
|
2578
|
-
const color1 = parseHexColor(c1);
|
|
2579
|
-
const color2 = parseHexColor(c2);
|
|
2580
|
-
if (color1 === null || color2 === null) {
|
|
2581
|
-
return null;
|
|
2582
|
-
}
|
|
2583
|
-
const red = Math.round(color1.red * weight1 + color2.red * weight2);
|
|
2584
|
-
const green = Math.round(color1.green * weight1 + color2.green * weight2);
|
|
2585
|
-
const blue = Math.round(color1.blue * weight1 + color2.blue * weight2);
|
|
2586
|
-
const intToHex = (value) => value.toString(16).padStart(2, "0");
|
|
2587
|
-
return `#${intToHex(red)}${intToHex(green)}${intToHex(blue)}`;
|
|
2588
|
-
}
|
|
2589
|
-
function parseHexColor(value) {
|
|
2590
|
-
if (!/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(value)) {
|
|
2591
|
-
return null;
|
|
2592
|
-
}
|
|
2593
|
-
const hexToInt = (value2) => parseInt(value2, 16);
|
|
2594
|
-
let red;
|
|
2595
|
-
let green;
|
|
2596
|
-
let blue;
|
|
2597
|
-
if (value.length === 4) {
|
|
2598
|
-
red = hexToInt(value[1] + value[1]);
|
|
2599
|
-
green = hexToInt(value[2] + value[2]);
|
|
2600
|
-
blue = hexToInt(value[3] + value[3]);
|
|
2601
|
-
} else {
|
|
2602
|
-
red = hexToInt(value.slice(1, 3));
|
|
2603
|
-
green = hexToInt(value.slice(3, 5));
|
|
2604
|
-
blue = hexToInt(value.slice(5, 7));
|
|
2605
|
-
}
|
|
2606
|
-
return { red, green, blue };
|
|
2607
|
-
}
|
|
2608
2800
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2609
2801
|
0 && (module.exports = {
|
|
2610
2802
|
generateSCSSTheme
|