@tenphi/glaze 1.3.1 → 1.4.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/dist/index.d.cts CHANGED
@@ -271,14 +271,44 @@ interface OklchColor {
271
271
  h: number;
272
272
  }
273
273
  interface RegularColorDef {
274
+ /**
275
+ * Seed this color from a literal color instead of from the theme.
276
+ *
277
+ * Accepts the same values as `glaze.color()` — hex, `rgb()`, `hsl()`,
278
+ * `okhsl()`, `okhst()`, `oklch()`, or a value object. It supplies three
279
+ * things at once: `hue`, `tone`, and — unlike every other color in a theme —
280
+ * an **absolute saturation** rather than a factor of the seed. That last
281
+ * part is the point: a color can now be more saturated than its theme, so
282
+ * honoring a brand color no longer means re-seeding the whole theme to reach
283
+ * it.
284
+ *
285
+ * The **light, normal-contrast** variant reproduces the value exactly
286
+ * (a local `lightTone: false`, matching the value-shorthand form of
287
+ * `glaze.color()`). Dark and high-contrast variants adapt as usual — they
288
+ * are where readability outranks fidelity, and a color pinned across every
289
+ * scheme would defeat both. A `contrast` floor still applies everywhere and
290
+ * still only moves the color when the authored value misses it.
291
+ *
292
+ * Sibling fields override what the value supplied, so
293
+ * `{ from: '#2F5BFF', hue: 300 }` keeps its saturation and tone but rotates
294
+ * the hue.
295
+ */
296
+ from?: GlazeColorValue;
274
297
  /**
275
298
  * Tone value (0–100, contrast-uniform — see `docs/okhst.md`).
276
299
  * - Number: absolute tone.
277
300
  * - String ('+N' / '-N'): relative to base color's tone (requires `base`).
278
301
  * - `'max'` / `'min'`: force to the scheme's tone extreme (no base needed).
302
+ *
303
+ * Defaults to the tone of `from` when that is set.
279
304
  */
280
305
  tone?: HCPair<ToneValue>;
281
- /** Saturation factor applied to the seed saturation (0–1, default: 1). */
306
+ /**
307
+ * Saturation factor applied to the seed saturation (0–1, default: 1).
308
+ *
309
+ * With `from`, an explicit value here is still a factor of the seed and
310
+ * overrides the absolute saturation the color carried.
311
+ */
282
312
  saturation?: number;
283
313
  /**
284
314
  * Hue override for this color.
package/dist/index.d.mts CHANGED
@@ -271,14 +271,44 @@ interface OklchColor {
271
271
  h: number;
272
272
  }
273
273
  interface RegularColorDef {
274
+ /**
275
+ * Seed this color from a literal color instead of from the theme.
276
+ *
277
+ * Accepts the same values as `glaze.color()` — hex, `rgb()`, `hsl()`,
278
+ * `okhsl()`, `okhst()`, `oklch()`, or a value object. It supplies three
279
+ * things at once: `hue`, `tone`, and — unlike every other color in a theme —
280
+ * an **absolute saturation** rather than a factor of the seed. That last
281
+ * part is the point: a color can now be more saturated than its theme, so
282
+ * honoring a brand color no longer means re-seeding the whole theme to reach
283
+ * it.
284
+ *
285
+ * The **light, normal-contrast** variant reproduces the value exactly
286
+ * (a local `lightTone: false`, matching the value-shorthand form of
287
+ * `glaze.color()`). Dark and high-contrast variants adapt as usual — they
288
+ * are where readability outranks fidelity, and a color pinned across every
289
+ * scheme would defeat both. A `contrast` floor still applies everywhere and
290
+ * still only moves the color when the authored value misses it.
291
+ *
292
+ * Sibling fields override what the value supplied, so
293
+ * `{ from: '#2F5BFF', hue: 300 }` keeps its saturation and tone but rotates
294
+ * the hue.
295
+ */
296
+ from?: GlazeColorValue;
274
297
  /**
275
298
  * Tone value (0–100, contrast-uniform — see `docs/okhst.md`).
276
299
  * - Number: absolute tone.
277
300
  * - String ('+N' / '-N'): relative to base color's tone (requires `base`).
278
301
  * - `'max'` / `'min'`: force to the scheme's tone extreme (no base needed).
302
+ *
303
+ * Defaults to the tone of `from` when that is set.
279
304
  */
280
305
  tone?: HCPair<ToneValue>;
281
- /** Saturation factor applied to the seed saturation (0–1, default: 1). */
306
+ /**
307
+ * Saturation factor applied to the seed saturation (0–1, default: 1).
308
+ *
309
+ * With `from`, an explicit value here is still a factor of the seed and
310
+ * overrides the absolute saturation the color carried.
311
+ */
282
312
  saturation?: number;
283
313
  /**
284
314
  * Hue override for this color.