@tenphi/glaze 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/api.md CHANGED
@@ -447,7 +447,8 @@ It gives an exact contrast step for neutrals and a stable visual progression for
447
447
  chromatic colors. In dark mode with `mode: 'auto'`, it is anchored to the
448
448
  base's per-scheme tone. If `base + delta` falls outside `[0, 100]`, the result
449
449
  is clamped to the boundary, or — with `autoFlip` (default on) — mirrored to the
450
- other side of the base.
450
+ other side of the base. If the mirrored target is also out of range, the original
451
+ delta is kept and clamped on the authored side.
451
452
 
452
453
  **Extreme tone** (`'max'` / `'min'`) forces the color to the scheme's tone extreme without a contrast hack or a magic number. `'max'` resolves to author tone 100 and `'min'` to 0; both flow through scheme mapping like an absolute tone, so under `mode: 'auto'` they invert in dark (`'max'` is lightest in light, darkest in dark). Use `mode: 'static'` to pin the same extreme across schemes, or `mode: 'fixed'` to keep the same end without inverting. No `base` required.
453
454
 
@@ -457,7 +458,7 @@ A dependent color with `base` but no `tone` inherits the base's tone (equivalent
457
458
 
458
459
  `autoFlip` governs what happens when a result would fall outside its valid range:
459
460
 
460
- - **Relative `tone` overshoot:** when `base ± delta` exceeds `[0, 100]`, `autoFlip` mirrors the delta to the other side of the base (e.g. `'+30'` becomes `'-30'`) instead of clamping to the boundary.
461
+ - **Relative `tone` overshoot:** when `base ± delta` exceeds `[0, 100]`, `autoFlip` mirrors the delta to the other side of the base (e.g. `'+30'` becomes `'-30'`) instead of clamping to the boundary. If the mirrored target is also outside `[0, 100]`, the original delta is kept and clamped on the authored side.
461
462
  - **`contrast` direction:** when the requested tone direction can't meet the floor, `autoFlip` lets the solver try the opposite side (the same behavior as the global `autoFlip`).
462
463
 
463
464
  `autoFlip` defaults to the global `autoFlip` (`true`). Set `autoFlip: false` on a color to clamp instead of mirror — useful when you want a relative offset to stay on the authored side of the base, or to keep an unmet contrast pinned to one direction's extreme.
@@ -1390,7 +1391,7 @@ Light: accent-fill tone=52, accent-text tone='+20' → lighter than the fill
1390
1391
  Dark: accent-fill maps into the dark window, sign preserved
1391
1392
  ```
1392
1393
 
1393
- Offsets that would push past `[0, 100]` clamp to the boundary, or — with `autoFlip` (default on) — mirror to the other side of the base. Set `autoFlip: false` to keep the authored side and clamp instead.
1394
+ Offsets that would push past `[0, 100]` clamp to the boundary, or — with `autoFlip` (default on) — mirror to the other side of the base. If the mirror also overshoots, the original side is kept and clamped. Set `autoFlip: false` to keep the authored side and clamp instead.
1394
1395
 
1395
1396
  **`static`** — no adaptation, same tone in every scheme.
1396
1397
 
@@ -1541,7 +1542,7 @@ available result.
1541
1542
  | Relative `tone` without `base` in a **theme** color | Validation error |
1542
1543
  | `contrast` without `base` in `glaze.color()` | Anchors against the literal seed (no error) |
1543
1544
  | Relative `tone` without `base` in `glaze.color()` | Anchors against the literal seed (no error) |
1544
- | Relative `tone` overshoots `[0, 100]` | Mirror to the other side of the base (`autoFlip` on, default), or clamp to the boundary (`autoFlip` off) |
1545
+ | Relative `tone` overshoots `[0, 100]` | Mirror to the other side of the base (`autoFlip` on, default), or clamp to the boundary (`autoFlip` off). If the mirror also overshoots, clamp on the authored side. |
1545
1546
  | `tone` resolves outside 0–100 | Clamp silently |
1546
1547
  | `'max'` / `'min'` without `base` | Allowed — resolves to the scheme's tone extreme (root color) |
1547
1548
  | `saturation` outside 0–1 | Clamp silently |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/glaze",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "OKHST-based color theme generator with WCAG contrast solving for light, dark, and high-contrast schemes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",