hextimator 0.10.0 → 0.10.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/CHANGELOG.md +6 -0
- package/dist/{chunk-ZUOHHUCY.js → chunk-64DBUA5U.js} +12 -1
- package/dist/cli.js +12 -1
- package/dist/index.js +1 -1
- package/dist/react.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 0.10.1
|
|
2
|
+
|
|
3
|
+
### Patch Changes
|
|
4
|
+
|
|
5
|
+
- [#135](https://github.com/fgrgic/hextimator/pull/135) [`90b3920`](https://github.com/fgrgic/hextimator/commit/90b3920ba60580dfd038bd0e46d0796feffdf718) Thanks [@fgrgic](https://github.com/fgrgic)! - fix wrong priority of parameters for style. `baseLightness` should always take priority if set when calculating the lightness.
|
|
6
|
+
|
|
1
7
|
## 0.10.0
|
|
2
8
|
|
|
3
9
|
### Minor Changes
|
|
@@ -1139,6 +1139,17 @@ function constrainAccentVariantVsSurface(themeType, variant, foreground, contras
|
|
|
1139
1139
|
}
|
|
1140
1140
|
return v;
|
|
1141
1141
|
}
|
|
1142
|
+
function hasExplicitBaseLightnessAnchor(themeType, options) {
|
|
1143
|
+
if (!options) return false;
|
|
1144
|
+
const global = extractGlobalThemeAdjustments(
|
|
1145
|
+
options
|
|
1146
|
+
);
|
|
1147
|
+
if (global.baseLightness !== void 0 || global.lightness !== void 0) {
|
|
1148
|
+
return true;
|
|
1149
|
+
}
|
|
1150
|
+
const branch = themeType === "light" ? options.light : options.dark;
|
|
1151
|
+
return branch?.baseLightness !== void 0 || branch?.lightness !== void 0;
|
|
1152
|
+
}
|
|
1142
1153
|
function expandColorToScale(color, themeType, options) {
|
|
1143
1154
|
const {
|
|
1144
1155
|
baselineLValueDark,
|
|
@@ -1168,7 +1179,7 @@ function expandColorToScale(color, themeType, options) {
|
|
|
1168
1179
|
const isSurfaceScale = baselineLValueLight !== void 0 || baselineLValueDark !== void 0;
|
|
1169
1180
|
const rawHueShift = themeAdjustments.hueShift ?? 0;
|
|
1170
1181
|
let useExactChip = false;
|
|
1171
|
-
if (!isSurfaceScale && !hasExplicitDeltas && rawHueShift === 0) {
|
|
1182
|
+
if (!isSurfaceScale && !hasExplicitDeltas && rawHueShift === 0 && !hasExplicitBaseLightnessAnchor(themeType, options)) {
|
|
1172
1183
|
const range = resolveBaseLightnessClampRange(themeType, options);
|
|
1173
1184
|
if (chipOKLCH.l >= range[0] && chipOKLCH.l <= range[1]) {
|
|
1174
1185
|
const chipFg = pickAccentForegroundPair(
|
package/dist/cli.js
CHANGED
|
@@ -1147,6 +1147,17 @@ function constrainAccentVariantVsSurface(themeType, variant, foreground, contras
|
|
|
1147
1147
|
}
|
|
1148
1148
|
return v;
|
|
1149
1149
|
}
|
|
1150
|
+
function hasExplicitBaseLightnessAnchor(themeType, options) {
|
|
1151
|
+
if (!options) return false;
|
|
1152
|
+
const global = extractGlobalThemeAdjustments(
|
|
1153
|
+
options
|
|
1154
|
+
);
|
|
1155
|
+
if (global.baseLightness !== void 0 || global.lightness !== void 0) {
|
|
1156
|
+
return true;
|
|
1157
|
+
}
|
|
1158
|
+
const branch = themeType === "light" ? options.light : options.dark;
|
|
1159
|
+
return branch?.baseLightness !== void 0 || branch?.lightness !== void 0;
|
|
1160
|
+
}
|
|
1150
1161
|
function expandColorToScale(color, themeType, options) {
|
|
1151
1162
|
const {
|
|
1152
1163
|
baselineLValueDark,
|
|
@@ -1176,7 +1187,7 @@ function expandColorToScale(color, themeType, options) {
|
|
|
1176
1187
|
const isSurfaceScale = baselineLValueLight !== void 0 || baselineLValueDark !== void 0;
|
|
1177
1188
|
const rawHueShift = themeAdjustments.hueShift ?? 0;
|
|
1178
1189
|
let useExactChip = false;
|
|
1179
|
-
if (!isSurfaceScale && !hasExplicitDeltas && rawHueShift === 0) {
|
|
1190
|
+
if (!isSurfaceScale && !hasExplicitDeltas && rawHueShift === 0 && !hasExplicitBaseLightnessAnchor(themeType, options)) {
|
|
1180
1191
|
const range = resolveBaseLightnessClampRange(themeType, options);
|
|
1181
1192
|
if (chipOKLCH.l >= range[0] && chipOKLCH.l <= range[1]) {
|
|
1182
1193
|
const chipFg = pickAccentForegroundPair(
|
package/dist/index.js
CHANGED
package/dist/react.js
CHANGED
package/package.json
CHANGED