@angular/material 18.2.0-rc.0 → 18.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/button/testing/index.d.ts +1 -1
- package/card/testing/index.d.ts +1 -1
- package/core/style/_menu-common.scss +1 -0
- package/core/testing/index.d.ts +2 -2
- package/core/tokens/m2/mat/_datepicker.scss +1 -1
- package/core/tokens/m2/mat/_standard-button-toggle.scss +1 -1
- package/core/tokens/m2/mdc/_checkbox.scss +2 -0
- package/core/tokens/m3/mat/_datepicker.scss +2 -2
- package/esm2022/button/testing/button-harness.mjs +2 -2
- package/esm2022/card/testing/card-harness.mjs +2 -2
- package/esm2022/checkbox/testing/checkbox-harness.mjs +7 -3
- package/esm2022/core/datetime/native-date-adapter.mjs +2 -2
- package/esm2022/core/testing/optgroup-harness.mjs +2 -2
- package/esm2022/core/testing/option-harness.mjs +2 -2
- package/esm2022/core/version.mjs +1 -1
- package/esm2022/datepicker/calendar-body.mjs +3 -3
- package/esm2022/datepicker/calendar.mjs +3 -3
- package/esm2022/expansion/expansion-animations.mjs +2 -2
- package/esm2022/form-field/form-field.mjs +18 -6
- package/esm2022/form-field/testing/error-harness.mjs +2 -2
- package/esm2022/icon/icon-registry.mjs +3 -4
- package/esm2022/list/list-option.mjs +1 -1
- package/esm2022/list/testing/action-list-harness.mjs +2 -2
- package/esm2022/list/testing/list-harness.mjs +2 -2
- package/esm2022/list/testing/list-item-harness-base.mjs +2 -2
- package/esm2022/list/testing/nav-list-harness.mjs +3 -3
- package/esm2022/list/testing/selection-list-harness.mjs +2 -2
- package/esm2022/menu/menu.mjs +3 -3
- package/esm2022/menu/testing/menu-harness.mjs +2 -2
- package/esm2022/progress-bar/testing/progress-bar-harness.mjs +2 -2
- package/esm2022/radio/testing/radio-harness.mjs +9 -5
- package/esm2022/select/testing/select-harness.mjs +2 -2
- package/esm2022/slide-toggle/slide-toggle.mjs +3 -3
- package/esm2022/slide-toggle/testing/slide-toggle-harness.mjs +7 -3
- package/esm2022/snack-bar/testing/snack-bar-harness.mjs +2 -2
- package/esm2022/tabs/tab-group.mjs +10 -4
- package/esm2022/tabs/tab-header.mjs +9 -3
- package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +3 -3
- package/esm2022/tabs/testing/tab-group-harness.mjs +2 -2
- package/esm2022/tabs/testing/tab-link-harness.mjs +2 -2
- package/esm2022/tabs/testing/tab-nav-bar-harness.mjs +2 -2
- package/expansion/index.d.ts +1 -1
- package/fesm2022/button/testing.mjs +1 -1
- package/fesm2022/button/testing.mjs.map +1 -1
- package/fesm2022/card/testing.mjs +1 -1
- package/fesm2022/card/testing.mjs.map +1 -1
- package/fesm2022/checkbox/testing.mjs +6 -2
- package/fesm2022/checkbox/testing.mjs.map +1 -1
- package/fesm2022/core/testing.mjs +2 -2
- package/fesm2022/core/testing.mjs.map +1 -1
- package/fesm2022/core.mjs +2 -2
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/datepicker.mjs +4 -4
- package/fesm2022/datepicker.mjs.map +1 -1
- package/fesm2022/expansion.mjs +1 -1
- package/fesm2022/expansion.mjs.map +1 -1
- package/fesm2022/form-field/testing.mjs +1 -1
- package/fesm2022/form-field/testing.mjs.map +1 -1
- package/fesm2022/form-field.mjs +17 -5
- package/fesm2022/form-field.mjs.map +1 -1
- package/fesm2022/icon.mjs +2 -3
- package/fesm2022/icon.mjs.map +1 -1
- package/fesm2022/list/testing.mjs +6 -6
- package/fesm2022/list/testing.mjs.map +1 -1
- package/fesm2022/list.mjs.map +1 -1
- package/fesm2022/menu/testing.mjs +1 -1
- package/fesm2022/menu/testing.mjs.map +1 -1
- package/fesm2022/menu.mjs +2 -2
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/progress-bar/testing.mjs +1 -1
- package/fesm2022/progress-bar/testing.mjs.map +1 -1
- package/fesm2022/radio/testing.mjs +8 -4
- package/fesm2022/radio/testing.mjs.map +1 -1
- package/fesm2022/select/testing.mjs +1 -1
- package/fesm2022/select/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle/testing.mjs +6 -2
- package/fesm2022/slide-toggle/testing.mjs.map +1 -1
- package/fesm2022/slide-toggle.mjs +2 -2
- package/fesm2022/slide-toggle.mjs.map +1 -1
- package/fesm2022/snack-bar/testing.mjs +1 -1
- package/fesm2022/snack-bar/testing.mjs.map +1 -1
- package/fesm2022/tabs/testing.mjs +3 -3
- package/fesm2022/tabs/testing.mjs.map +1 -1
- package/fesm2022/tabs.mjs +19 -7
- package/fesm2022/tabs.mjs.map +1 -1
- package/form-field/_form-field-native-select.scss +1 -1
- package/form-field/index.d.ts +3 -0
- package/form-field/testing/index.d.ts +1 -1
- package/list/index.d.ts +1 -1
- package/list/testing/index.d.ts +6 -6
- package/menu/testing/index.d.ts +1 -1
- package/package.json +7 -7
- 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/testing/index.d.ts +1 -1
- package/radio/testing/index.d.ts +2 -2
- package/schematics/ng-add/index.js +2 -2
- package/schematics/ng-add/index.mjs +2 -2
- package/schematics/ng-generate/m3-theme/index_bundled.js +220 -317
- package/schematics/ng-generate/m3-theme/index_bundled.js.map +4 -4
- package/schematics/ng-update/index_bundled.js +31 -31
- package/select/testing/index.d.ts +1 -1
- package/snack-bar/testing/index.d.ts +1 -1
- package/tabs/_tabs-common.scss +0 -3
- package/tabs/index.d.ts +10 -2
- package/tabs/testing/index.d.ts +3 -3
|
@@ -50,7 +50,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
// bazel-out/
|
|
53
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/m3-theme/index.mjs
|
|
54
54
|
var m3_theme_exports = {};
|
|
55
55
|
__export(m3_theme_exports, {
|
|
56
56
|
default: () => m3_theme_default,
|
|
@@ -101,10 +101,6 @@ function sanitizeDegreesDouble(degrees) {
|
|
|
101
101
|
}
|
|
102
102
|
return degrees;
|
|
103
103
|
}
|
|
104
|
-
function rotationDirection(from, to) {
|
|
105
|
-
const increasingDifference = sanitizeDegreesDouble(to - from);
|
|
106
|
-
return increasingDifference <= 180 ? 1 : -1;
|
|
107
|
-
}
|
|
108
104
|
function differenceDegrees(a, b) {
|
|
109
105
|
return 180 - Math.abs(Math.abs(a - b) - 180);
|
|
110
106
|
}
|
|
@@ -173,6 +169,26 @@ function xyzFromArgb(argb) {
|
|
|
173
169
|
const b = linearized(blueFromArgb(argb));
|
|
174
170
|
return matrixMultiply([r, g, b], SRGB_TO_XYZ);
|
|
175
171
|
}
|
|
172
|
+
function labFromArgb(argb) {
|
|
173
|
+
const linearR = linearized(redFromArgb(argb));
|
|
174
|
+
const linearG = linearized(greenFromArgb(argb));
|
|
175
|
+
const linearB = linearized(blueFromArgb(argb));
|
|
176
|
+
const matrix = SRGB_TO_XYZ;
|
|
177
|
+
const x = matrix[0][0] * linearR + matrix[0][1] * linearG + matrix[0][2] * linearB;
|
|
178
|
+
const y = matrix[1][0] * linearR + matrix[1][1] * linearG + matrix[1][2] * linearB;
|
|
179
|
+
const z = matrix[2][0] * linearR + matrix[2][1] * linearG + matrix[2][2] * linearB;
|
|
180
|
+
const whitePoint = WHITE_POINT_D65;
|
|
181
|
+
const xNormalized = x / whitePoint[0];
|
|
182
|
+
const yNormalized = y / whitePoint[1];
|
|
183
|
+
const zNormalized = z / whitePoint[2];
|
|
184
|
+
const fx = labF(xNormalized);
|
|
185
|
+
const fy = labF(yNormalized);
|
|
186
|
+
const fz = labF(zNormalized);
|
|
187
|
+
const l = 116 * fy - 16;
|
|
188
|
+
const a = 500 * (fx - fy);
|
|
189
|
+
const b = 200 * (fy - fz);
|
|
190
|
+
return [l, a, b];
|
|
191
|
+
}
|
|
176
192
|
function argbFromLstar(lstar) {
|
|
177
193
|
const y = yFromLstar(lstar);
|
|
178
194
|
const component = delinearized(y);
|
|
@@ -1071,39 +1087,6 @@ var Hct = class {
|
|
|
1071
1087
|
}
|
|
1072
1088
|
};
|
|
1073
1089
|
|
|
1074
|
-
// node_modules/@material/material-color-utilities/blend/blend.js
|
|
1075
|
-
var Blend = class {
|
|
1076
|
-
static harmonize(designColor, sourceColor) {
|
|
1077
|
-
const fromHct = Hct.fromInt(designColor);
|
|
1078
|
-
const toHct = Hct.fromInt(sourceColor);
|
|
1079
|
-
const differenceDegrees2 = differenceDegrees(fromHct.hue, toHct.hue);
|
|
1080
|
-
const rotationDegrees = Math.min(differenceDegrees2 * 0.5, 15);
|
|
1081
|
-
const outputHue = sanitizeDegreesDouble(fromHct.hue + rotationDegrees * rotationDirection(fromHct.hue, toHct.hue));
|
|
1082
|
-
return Hct.from(outputHue, fromHct.chroma, fromHct.tone).toInt();
|
|
1083
|
-
}
|
|
1084
|
-
static hctHue(from, to, amount) {
|
|
1085
|
-
const ucs = Blend.cam16Ucs(from, to, amount);
|
|
1086
|
-
const ucsCam = Cam16.fromInt(ucs);
|
|
1087
|
-
const fromCam = Cam16.fromInt(from);
|
|
1088
|
-
const blended = Hct.from(ucsCam.hue, fromCam.chroma, lstarFromArgb(from));
|
|
1089
|
-
return blended.toInt();
|
|
1090
|
-
}
|
|
1091
|
-
static cam16Ucs(from, to, amount) {
|
|
1092
|
-
const fromCam = Cam16.fromInt(from);
|
|
1093
|
-
const toCam = Cam16.fromInt(to);
|
|
1094
|
-
const fromJ = fromCam.jstar;
|
|
1095
|
-
const fromA = fromCam.astar;
|
|
1096
|
-
const fromB = fromCam.bstar;
|
|
1097
|
-
const toJ = toCam.jstar;
|
|
1098
|
-
const toA = toCam.astar;
|
|
1099
|
-
const toB = toCam.bstar;
|
|
1100
|
-
const jstar = fromJ + (toJ - fromJ) * amount;
|
|
1101
|
-
const astar = fromA + (toA - fromA) * amount;
|
|
1102
|
-
const bstar = fromB + (toB - fromB) * amount;
|
|
1103
|
-
return Cam16.fromUcs(jstar, astar, bstar).toInt();
|
|
1104
|
-
}
|
|
1105
|
-
};
|
|
1106
|
-
|
|
1107
1090
|
// node_modules/@material/material-color-utilities/contrast/contrast.js
|
|
1108
1091
|
var Contrast = class {
|
|
1109
1092
|
static ratioOfTones(toneA, toneB) {
|
|
@@ -1970,65 +1953,6 @@ var TonalPalette = class {
|
|
|
1970
1953
|
}
|
|
1971
1954
|
};
|
|
1972
1955
|
|
|
1973
|
-
// node_modules/@material/material-color-utilities/palettes/core_palette.js
|
|
1974
|
-
var CorePalette = class {
|
|
1975
|
-
static of(argb) {
|
|
1976
|
-
return new CorePalette(argb, false);
|
|
1977
|
-
}
|
|
1978
|
-
static contentOf(argb) {
|
|
1979
|
-
return new CorePalette(argb, true);
|
|
1980
|
-
}
|
|
1981
|
-
static fromColors(colors) {
|
|
1982
|
-
return CorePalette.createPaletteFromColors(false, colors);
|
|
1983
|
-
}
|
|
1984
|
-
static contentFromColors(colors) {
|
|
1985
|
-
return CorePalette.createPaletteFromColors(true, colors);
|
|
1986
|
-
}
|
|
1987
|
-
static createPaletteFromColors(content, colors) {
|
|
1988
|
-
const palette = new CorePalette(colors.primary, content);
|
|
1989
|
-
if (colors.secondary) {
|
|
1990
|
-
const p = new CorePalette(colors.secondary, content);
|
|
1991
|
-
palette.a2 = p.a1;
|
|
1992
|
-
}
|
|
1993
|
-
if (colors.tertiary) {
|
|
1994
|
-
const p = new CorePalette(colors.tertiary, content);
|
|
1995
|
-
palette.a3 = p.a1;
|
|
1996
|
-
}
|
|
1997
|
-
if (colors.error) {
|
|
1998
|
-
const p = new CorePalette(colors.error, content);
|
|
1999
|
-
palette.error = p.a1;
|
|
2000
|
-
}
|
|
2001
|
-
if (colors.neutral) {
|
|
2002
|
-
const p = new CorePalette(colors.neutral, content);
|
|
2003
|
-
palette.n1 = p.n1;
|
|
2004
|
-
}
|
|
2005
|
-
if (colors.neutralVariant) {
|
|
2006
|
-
const p = new CorePalette(colors.neutralVariant, content);
|
|
2007
|
-
palette.n2 = p.n2;
|
|
2008
|
-
}
|
|
2009
|
-
return palette;
|
|
2010
|
-
}
|
|
2011
|
-
constructor(argb, isContent) {
|
|
2012
|
-
const hct = Hct.fromInt(argb);
|
|
2013
|
-
const hue = hct.hue;
|
|
2014
|
-
const chroma = hct.chroma;
|
|
2015
|
-
if (isContent) {
|
|
2016
|
-
this.a1 = TonalPalette.fromHueAndChroma(hue, chroma);
|
|
2017
|
-
this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3);
|
|
2018
|
-
this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2);
|
|
2019
|
-
this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4));
|
|
2020
|
-
this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8));
|
|
2021
|
-
} else {
|
|
2022
|
-
this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma));
|
|
2023
|
-
this.a2 = TonalPalette.fromHueAndChroma(hue, 16);
|
|
2024
|
-
this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24);
|
|
2025
|
-
this.n1 = TonalPalette.fromHueAndChroma(hue, 4);
|
|
2026
|
-
this.n2 = TonalPalette.fromHueAndChroma(hue, 8);
|
|
2027
|
-
}
|
|
2028
|
-
this.error = TonalPalette.fromHueAndChroma(25, 84);
|
|
2029
|
-
}
|
|
2030
|
-
};
|
|
2031
|
-
|
|
2032
1956
|
// node_modules/@material/material-color-utilities/scheme/dynamic_scheme.js
|
|
2033
1957
|
var DynamicScheme = class {
|
|
2034
1958
|
constructor(args) {
|
|
@@ -2064,179 +1988,200 @@ var DynamicScheme = class {
|
|
|
2064
1988
|
}
|
|
2065
1989
|
};
|
|
2066
1990
|
|
|
2067
|
-
// node_modules/@material/material-color-utilities/
|
|
2068
|
-
var
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
return
|
|
2086
|
-
}
|
|
2087
|
-
get
|
|
2088
|
-
return this.
|
|
2089
|
-
}
|
|
2090
|
-
get
|
|
2091
|
-
return this.
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
1991
|
+
// node_modules/@material/material-color-utilities/temperature/temperature_cache.js
|
|
1992
|
+
var TemperatureCache = class {
|
|
1993
|
+
constructor(input) {
|
|
1994
|
+
this.input = input;
|
|
1995
|
+
this.hctsByTempCache = [];
|
|
1996
|
+
this.hctsByHueCache = [];
|
|
1997
|
+
this.tempsByHctCache = /* @__PURE__ */ new Map();
|
|
1998
|
+
this.inputRelativeTemperatureCache = -1;
|
|
1999
|
+
this.complementCache = null;
|
|
2000
|
+
}
|
|
2001
|
+
get hctsByTemp() {
|
|
2002
|
+
if (this.hctsByTempCache.length > 0) {
|
|
2003
|
+
return this.hctsByTempCache;
|
|
2004
|
+
}
|
|
2005
|
+
const hcts = this.hctsByHue.concat([this.input]);
|
|
2006
|
+
const temperaturesByHct = this.tempsByHct;
|
|
2007
|
+
hcts.sort((a, b) => temperaturesByHct.get(a) - temperaturesByHct.get(b));
|
|
2008
|
+
this.hctsByTempCache = hcts;
|
|
2009
|
+
return hcts;
|
|
2010
|
+
}
|
|
2011
|
+
get warmest() {
|
|
2012
|
+
return this.hctsByTemp[this.hctsByTemp.length - 1];
|
|
2013
|
+
}
|
|
2014
|
+
get coldest() {
|
|
2015
|
+
return this.hctsByTemp[0];
|
|
2016
|
+
}
|
|
2017
|
+
analogous(count = 5, divisions = 12) {
|
|
2018
|
+
const startHue = Math.round(this.input.hue);
|
|
2019
|
+
const startHct = this.hctsByHue[startHue];
|
|
2020
|
+
let lastTemp = this.relativeTemperature(startHct);
|
|
2021
|
+
const allColors = [startHct];
|
|
2022
|
+
let absoluteTotalTempDelta = 0;
|
|
2023
|
+
for (let i = 0; i < 360; i++) {
|
|
2024
|
+
const hue = sanitizeDegreesInt(startHue + i);
|
|
2025
|
+
const hct = this.hctsByHue[hue];
|
|
2026
|
+
const temp = this.relativeTemperature(hct);
|
|
2027
|
+
const tempDelta = Math.abs(temp - lastTemp);
|
|
2028
|
+
lastTemp = temp;
|
|
2029
|
+
absoluteTotalTempDelta += tempDelta;
|
|
2030
|
+
}
|
|
2031
|
+
let hueAddend = 1;
|
|
2032
|
+
const tempStep = absoluteTotalTempDelta / divisions;
|
|
2033
|
+
let totalTempDelta = 0;
|
|
2034
|
+
lastTemp = this.relativeTemperature(startHct);
|
|
2035
|
+
while (allColors.length < divisions) {
|
|
2036
|
+
const hue = sanitizeDegreesInt(startHue + hueAddend);
|
|
2037
|
+
const hct = this.hctsByHue[hue];
|
|
2038
|
+
const temp = this.relativeTemperature(hct);
|
|
2039
|
+
const tempDelta = Math.abs(temp - lastTemp);
|
|
2040
|
+
totalTempDelta += tempDelta;
|
|
2041
|
+
const desiredTotalTempDeltaForIndex = allColors.length * tempStep;
|
|
2042
|
+
let indexSatisfied = totalTempDelta >= desiredTotalTempDeltaForIndex;
|
|
2043
|
+
let indexAddend = 1;
|
|
2044
|
+
while (indexSatisfied && allColors.length < divisions) {
|
|
2045
|
+
allColors.push(hct);
|
|
2046
|
+
const desiredTotalTempDeltaForIndex2 = (allColors.length + indexAddend) * tempStep;
|
|
2047
|
+
indexSatisfied = totalTempDelta >= desiredTotalTempDeltaForIndex2;
|
|
2048
|
+
indexAddend++;
|
|
2049
|
+
}
|
|
2050
|
+
lastTemp = temp;
|
|
2051
|
+
hueAddend++;
|
|
2052
|
+
if (hueAddend > 360) {
|
|
2053
|
+
while (allColors.length < divisions) {
|
|
2054
|
+
allColors.push(hct);
|
|
2055
|
+
}
|
|
2056
|
+
break;
|
|
2057
|
+
}
|
|
2058
|
+
}
|
|
2059
|
+
const answers = [this.input];
|
|
2060
|
+
const increaseHueCount = Math.floor((count - 1) / 2);
|
|
2061
|
+
for (let i = 1; i < increaseHueCount + 1; i++) {
|
|
2062
|
+
let index = 0 - i;
|
|
2063
|
+
while (index < 0) {
|
|
2064
|
+
index = allColors.length + index;
|
|
2065
|
+
}
|
|
2066
|
+
if (index >= allColors.length) {
|
|
2067
|
+
index = index % allColors.length;
|
|
2068
|
+
}
|
|
2069
|
+
answers.splice(0, 0, allColors[index]);
|
|
2070
|
+
}
|
|
2071
|
+
const decreaseHueCount = count - increaseHueCount - 1;
|
|
2072
|
+
for (let i = 1; i < decreaseHueCount + 1; i++) {
|
|
2073
|
+
let index = i;
|
|
2074
|
+
while (index < 0) {
|
|
2075
|
+
index = allColors.length + index;
|
|
2076
|
+
}
|
|
2077
|
+
if (index >= allColors.length) {
|
|
2078
|
+
index = index % allColors.length;
|
|
2079
|
+
}
|
|
2080
|
+
answers.push(allColors[index]);
|
|
2081
|
+
}
|
|
2082
|
+
return answers;
|
|
2083
|
+
}
|
|
2084
|
+
get complement() {
|
|
2085
|
+
if (this.complementCache != null) {
|
|
2086
|
+
return this.complementCache;
|
|
2087
|
+
}
|
|
2088
|
+
const coldestHue = this.coldest.hue;
|
|
2089
|
+
const coldestTemp = this.tempsByHct.get(this.coldest);
|
|
2090
|
+
const warmestHue = this.warmest.hue;
|
|
2091
|
+
const warmestTemp = this.tempsByHct.get(this.warmest);
|
|
2092
|
+
const range = warmestTemp - coldestTemp;
|
|
2093
|
+
const startHueIsColdestToWarmest = TemperatureCache.isBetween(this.input.hue, coldestHue, warmestHue);
|
|
2094
|
+
const startHue = startHueIsColdestToWarmest ? warmestHue : coldestHue;
|
|
2095
|
+
const endHue = startHueIsColdestToWarmest ? coldestHue : warmestHue;
|
|
2096
|
+
const directionOfRotation = 1;
|
|
2097
|
+
let smallestError = 1e3;
|
|
2098
|
+
let answer = this.hctsByHue[Math.round(this.input.hue)];
|
|
2099
|
+
const complementRelativeTemp = 1 - this.inputRelativeTemperature;
|
|
2100
|
+
for (let hueAddend = 0; hueAddend <= 360; hueAddend += 1) {
|
|
2101
|
+
const hue = sanitizeDegreesDouble(startHue + directionOfRotation * hueAddend);
|
|
2102
|
+
if (!TemperatureCache.isBetween(hue, startHue, endHue)) {
|
|
2103
|
+
continue;
|
|
2104
|
+
}
|
|
2105
|
+
const possibleAnswer = this.hctsByHue[Math.round(hue)];
|
|
2106
|
+
const relativeTemp = (this.tempsByHct.get(possibleAnswer) - coldestTemp) / range;
|
|
2107
|
+
const error = Math.abs(complementRelativeTemp - relativeTemp);
|
|
2108
|
+
if (error < smallestError) {
|
|
2109
|
+
smallestError = error;
|
|
2110
|
+
answer = possibleAnswer;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
this.complementCache = answer;
|
|
2114
|
+
return this.complementCache;
|
|
2152
2115
|
}
|
|
2153
|
-
|
|
2154
|
-
|
|
2116
|
+
relativeTemperature(hct) {
|
|
2117
|
+
const range = this.tempsByHct.get(this.warmest) - this.tempsByHct.get(this.coldest);
|
|
2118
|
+
const differenceFromColdest = this.tempsByHct.get(hct) - this.tempsByHct.get(this.coldest);
|
|
2119
|
+
if (range === 0) {
|
|
2120
|
+
return 0.5;
|
|
2121
|
+
}
|
|
2122
|
+
return differenceFromColdest / range;
|
|
2155
2123
|
}
|
|
2156
|
-
|
|
2157
|
-
|
|
2124
|
+
get inputRelativeTemperature() {
|
|
2125
|
+
if (this.inputRelativeTemperatureCache >= 0) {
|
|
2126
|
+
return this.inputRelativeTemperatureCache;
|
|
2127
|
+
}
|
|
2128
|
+
this.inputRelativeTemperatureCache = this.relativeTemperature(this.input);
|
|
2129
|
+
return this.inputRelativeTemperatureCache;
|
|
2158
2130
|
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2131
|
+
get tempsByHct() {
|
|
2132
|
+
if (this.tempsByHctCache.size > 0) {
|
|
2133
|
+
return this.tempsByHctCache;
|
|
2134
|
+
}
|
|
2135
|
+
const allHcts = this.hctsByHue.concat([this.input]);
|
|
2136
|
+
const temperaturesByHct = /* @__PURE__ */ new Map();
|
|
2137
|
+
for (const e of allHcts) {
|
|
2138
|
+
temperaturesByHct.set(e, TemperatureCache.rawTemperature(e));
|
|
2139
|
+
}
|
|
2140
|
+
this.tempsByHctCache = temperaturesByHct;
|
|
2141
|
+
return temperaturesByHct;
|
|
2161
2142
|
}
|
|
2162
|
-
|
|
2163
|
-
|
|
2143
|
+
get hctsByHue() {
|
|
2144
|
+
if (this.hctsByHueCache.length > 0) {
|
|
2145
|
+
return this.hctsByHueCache;
|
|
2146
|
+
}
|
|
2147
|
+
const hcts = [];
|
|
2148
|
+
for (let hue = 0; hue <= 360; hue += 1) {
|
|
2149
|
+
const colorAtHue = Hct.from(hue, this.input.chroma, this.input.tone);
|
|
2150
|
+
hcts.push(colorAtHue);
|
|
2151
|
+
}
|
|
2152
|
+
this.hctsByHueCache = hcts;
|
|
2153
|
+
return this.hctsByHueCache;
|
|
2164
2154
|
}
|
|
2165
|
-
static
|
|
2166
|
-
|
|
2155
|
+
static isBetween(angle, a, b) {
|
|
2156
|
+
if (a < b) {
|
|
2157
|
+
return a <= angle && angle <= b;
|
|
2158
|
+
}
|
|
2159
|
+
return a <= angle || angle <= b;
|
|
2167
2160
|
}
|
|
2168
|
-
static
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
secondary: core.a2.tone(40),
|
|
2175
|
-
onSecondary: core.a2.tone(100),
|
|
2176
|
-
secondaryContainer: core.a2.tone(90),
|
|
2177
|
-
onSecondaryContainer: core.a2.tone(10),
|
|
2178
|
-
tertiary: core.a3.tone(40),
|
|
2179
|
-
onTertiary: core.a3.tone(100),
|
|
2180
|
-
tertiaryContainer: core.a3.tone(90),
|
|
2181
|
-
onTertiaryContainer: core.a3.tone(10),
|
|
2182
|
-
error: core.error.tone(40),
|
|
2183
|
-
onError: core.error.tone(100),
|
|
2184
|
-
errorContainer: core.error.tone(90),
|
|
2185
|
-
onErrorContainer: core.error.tone(10),
|
|
2186
|
-
background: core.n1.tone(99),
|
|
2187
|
-
onBackground: core.n1.tone(10),
|
|
2188
|
-
surface: core.n1.tone(99),
|
|
2189
|
-
onSurface: core.n1.tone(10),
|
|
2190
|
-
surfaceVariant: core.n2.tone(90),
|
|
2191
|
-
onSurfaceVariant: core.n2.tone(30),
|
|
2192
|
-
outline: core.n2.tone(50),
|
|
2193
|
-
outlineVariant: core.n2.tone(80),
|
|
2194
|
-
shadow: core.n1.tone(0),
|
|
2195
|
-
scrim: core.n1.tone(0),
|
|
2196
|
-
inverseSurface: core.n1.tone(20),
|
|
2197
|
-
inverseOnSurface: core.n1.tone(95),
|
|
2198
|
-
inversePrimary: core.a1.tone(80)
|
|
2199
|
-
});
|
|
2161
|
+
static rawTemperature(color) {
|
|
2162
|
+
const lab = labFromArgb(color.toInt());
|
|
2163
|
+
const hue = sanitizeDegreesDouble(Math.atan2(lab[2], lab[1]) * 180 / Math.PI);
|
|
2164
|
+
const chroma = Math.sqrt(lab[1] * lab[1] + lab[2] * lab[2]);
|
|
2165
|
+
const temperature = -0.5 + 0.02 * Math.pow(chroma, 1.07) * Math.cos(sanitizeDegreesDouble(hue - 50) * Math.PI / 180);
|
|
2166
|
+
return temperature;
|
|
2200
2167
|
}
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
onError: core.error.tone(20),
|
|
2217
|
-
errorContainer: core.error.tone(30),
|
|
2218
|
-
onErrorContainer: core.error.tone(80),
|
|
2219
|
-
background: core.n1.tone(10),
|
|
2220
|
-
onBackground: core.n1.tone(90),
|
|
2221
|
-
surface: core.n1.tone(10),
|
|
2222
|
-
onSurface: core.n1.tone(90),
|
|
2223
|
-
surfaceVariant: core.n2.tone(30),
|
|
2224
|
-
onSurfaceVariant: core.n2.tone(80),
|
|
2225
|
-
outline: core.n2.tone(60),
|
|
2226
|
-
outlineVariant: core.n2.tone(30),
|
|
2227
|
-
shadow: core.n1.tone(0),
|
|
2228
|
-
scrim: core.n1.tone(0),
|
|
2229
|
-
inverseSurface: core.n1.tone(90),
|
|
2230
|
-
inverseOnSurface: core.n1.tone(20),
|
|
2231
|
-
inversePrimary: core.a1.tone(40)
|
|
2168
|
+
};
|
|
2169
|
+
|
|
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)
|
|
2232
2183
|
});
|
|
2233
2184
|
}
|
|
2234
|
-
constructor(props) {
|
|
2235
|
-
this.props = props;
|
|
2236
|
-
}
|
|
2237
|
-
toJSON() {
|
|
2238
|
-
return __spreadValues({}, this.props);
|
|
2239
|
-
}
|
|
2240
2185
|
};
|
|
2241
2186
|
|
|
2242
2187
|
// node_modules/@material/material-color-utilities/scheme/scheme_expressive.js
|
|
@@ -2466,54 +2411,7 @@ function parseIntHex(value) {
|
|
|
2466
2411
|
return parseInt(value, 16);
|
|
2467
2412
|
}
|
|
2468
2413
|
|
|
2469
|
-
//
|
|
2470
|
-
function themeFromSourceColor(source, customColors = []) {
|
|
2471
|
-
const palette = CorePalette.of(source);
|
|
2472
|
-
return {
|
|
2473
|
-
source,
|
|
2474
|
-
schemes: {
|
|
2475
|
-
light: Scheme.light(source),
|
|
2476
|
-
dark: Scheme.dark(source)
|
|
2477
|
-
},
|
|
2478
|
-
palettes: {
|
|
2479
|
-
primary: palette.a1,
|
|
2480
|
-
secondary: palette.a2,
|
|
2481
|
-
tertiary: palette.a3,
|
|
2482
|
-
neutral: palette.n1,
|
|
2483
|
-
neutralVariant: palette.n2,
|
|
2484
|
-
error: palette.error
|
|
2485
|
-
},
|
|
2486
|
-
customColors: customColors.map((c) => customColor(source, c))
|
|
2487
|
-
};
|
|
2488
|
-
}
|
|
2489
|
-
function customColor(source, color) {
|
|
2490
|
-
let value = color.value;
|
|
2491
|
-
const from = value;
|
|
2492
|
-
const to = source;
|
|
2493
|
-
if (color.blend) {
|
|
2494
|
-
value = Blend.harmonize(from, to);
|
|
2495
|
-
}
|
|
2496
|
-
const palette = CorePalette.of(value);
|
|
2497
|
-
const tones = palette.a1;
|
|
2498
|
-
return {
|
|
2499
|
-
color,
|
|
2500
|
-
value,
|
|
2501
|
-
light: {
|
|
2502
|
-
color: tones.tone(40),
|
|
2503
|
-
onColor: tones.tone(100),
|
|
2504
|
-
colorContainer: tones.tone(90),
|
|
2505
|
-
onColorContainer: tones.tone(10)
|
|
2506
|
-
},
|
|
2507
|
-
dark: {
|
|
2508
|
-
color: tones.tone(80),
|
|
2509
|
-
onColor: tones.tone(20),
|
|
2510
|
-
colorContainer: tones.tone(30),
|
|
2511
|
-
onColorContainer: tones.tone(90)
|
|
2512
|
-
}
|
|
2513
|
-
};
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
|
-
// bazel-out/k8-fastbuild/bin/src/material/schematics/ng-generate/m3-theme/index.mjs
|
|
2414
|
+
// bazel-out/darwin-fastbuild/bin/src/material/schematics/ng-generate/m3-theme/index.mjs
|
|
2517
2415
|
var HUE_TONES = [0, 10, 20, 25, 30, 35, 40, 50, 60, 70, 80, 90, 95, 98, 99, 100];
|
|
2518
2416
|
var NEUTRAL_HUES = /* @__PURE__ */ new Map([
|
|
2519
2417
|
[4, { prev: 0, next: 10 }],
|
|
@@ -2531,14 +2429,19 @@ var NEUTRAL_HUE_TONES = [...HUE_TONES, ...NEUTRAL_HUES.keys()];
|
|
|
2531
2429
|
function getMaterialTonalPalettes(color) {
|
|
2532
2430
|
try {
|
|
2533
2431
|
let argbColor = argbFromHex(color);
|
|
2534
|
-
const
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2432
|
+
const scheme = new SchemeContent(
|
|
2433
|
+
Hct.fromInt(argbColor),
|
|
2434
|
+
false,
|
|
2435
|
+
0
|
|
2436
|
+
);
|
|
2437
|
+
return {
|
|
2438
|
+
primary: scheme.primaryPalette,
|
|
2439
|
+
secondary: scheme.secondaryPalette,
|
|
2440
|
+
tertiary: scheme.tertiaryPalette,
|
|
2441
|
+
neutral: scheme.neutralPalette,
|
|
2442
|
+
neutralVariant: scheme.neutralVariantPalette,
|
|
2443
|
+
error: scheme.errorPalette
|
|
2444
|
+
};
|
|
2542
2445
|
} catch (e) {
|
|
2543
2446
|
throw new Error("Cannot parse the specified color " + color + ". Please verify it is a hex color (ex. #ffffff or ffffff).");
|
|
2544
2447
|
}
|