@tenphi/glaze 0.0.0-snapshot.c3d484c → 0.0.0-snapshot.c61bbdf

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
@@ -296,7 +296,7 @@ interface RegularColorDef {
296
296
  */
297
297
  from?: GlazeColorValue;
298
298
  /**
299
- * Tone value (0–100, contrast-uniform — see `docs/okhst.md`).
299
+ * Tone value (0–100, contrast-uniform — see `docs/okhst.mdx`).
300
300
  * - Number: absolute tone.
301
301
  * - String ('+N' / '-N'): relative to base color's tone (requires `base`).
302
302
  * - `'max'` / `'min'`: force to the scheme's tone extreme (no base needed).
@@ -390,44 +390,63 @@ interface RegularColorDef {
390
390
  */
391
391
  inherit?: boolean;
392
392
  }
393
- /** Shadow tuning knobs. All values use the 0–1 scale (OKHSL). */
394
- interface ShadowTuning {
395
- /** Fraction of fg saturation kept in pigment (0-1). Default: 0.18. */
396
- saturationFactor?: number;
397
- /** Upper clamp on pigment saturation (0-1). Default: 0.25. */
398
- maxSaturation?: number;
399
- /** Multiplier for bg lightness → pigment lightness. Default: 0.25. */
400
- lightnessFactor?: number;
401
- /** [min, max] clamp for pigment lightness (0-1). Default: [0.05, 0.20]. */
402
- lightnessBounds?: [number, number];
393
+ /**
394
+ * Tuning shared by `shadow` and `glow`. Global defaults come from
395
+ * `shadowTuning` / `glowTuning`; a per-color `tuning` merges over them field
396
+ * by field.
397
+ */
398
+ interface LightingTuning {
403
399
  /**
404
- * Target minimum gap between pigment lightness and bg lightness (0-1).
405
- * Default: 0.05.
400
+ * β — how strongly the object (`fg`) scales the step. The step is
401
+ * `intensity × k` with `k = max(0, 1 + β · d · (t_bg − t_fg) / 100)`,
402
+ * `d = +1` for a shadow and `−1` for a glow: a darker object deepens its
403
+ * shadow, a lighter one strengthens its glow. An object at the surface's
404
+ * own tone (or no `fg`) gives exactly `intensity`. `0` ignores the object.
405
+ * Default: 0.5.
406
406
  */
407
- minGapTarget?: number;
408
- /** Max alpha (0-1). Reached at intensity=100 with max contrast. Default: 1.0. */
409
- alphaMax?: number;
407
+ objectInfluence?: number;
410
408
  /**
411
- * Blend weight (0-1) pulling pigment hue toward bg hue.
412
- * 0 = pure fg hue, 1 = pure bg hue. Default: 0.2.
409
+ * Pigment saturation (0–1) in the surface's hue. Default: 0 (neutral black /
410
+ * white). Shows only with `reach` below 1 — pure black and white have no hue.
413
411
  */
414
- bgHueBlend?: number;
412
+ tint?: number;
413
+ /**
414
+ * Where the pigment sits (0–1): the fraction of the way from the surface's
415
+ * tone to black (shadow) / white (glow). Default: 1 (pure black / white),
416
+ * the most reach. Lower values let a `tint` show at the cost of reach.
417
+ */
418
+ reach?: number;
419
+ /**
420
+ * Pull (0–1) of the pigment hue from the surface's hue toward the object's
421
+ * (`fg`) hue. Default: 0. Needs `fg`, a `tint`, and `reach` below 1 to show.
422
+ */
423
+ hueBleed?: number;
415
424
  }
425
+ /** Tuning for `shadow` colors. Same shape as {@link GlowTuning}. */
426
+ type ShadowTuning = LightingTuning;
427
+ /** Tuning for `glow` colors. Same shape as {@link ShadowTuning}. */
428
+ type GlowTuning = LightingTuning;
429
+ /**
430
+ * A translucent dark overlay that lands the surface (`bg`) exactly
431
+ * `intensity` tones darker in every scheme — a shade for state layers and
432
+ * scrims, or, with `fg`, an object-aware drop shadow.
433
+ */
416
434
  interface ShadowColorDef {
417
435
  type: 'shadow';
418
436
  /**
419
- * Background color name — the surface the shadow sits on.
420
- * Must reference a non-shadow color in the same theme.
437
+ * The surface the shadow falls on. Must reference a color that is not a
438
+ * shadow or glow.
421
439
  */
422
440
  bg: string;
423
441
  /**
424
- * Foreground color name for tinting and intensity modulation.
425
- * Must reference a non-shadow color in the same theme.
426
- * Omit for achromatic shadow at full user-specified intensity.
442
+ * The object casting the shadow (e.g. the card). A darker object casts a
443
+ * deeper shadow, a lighter one a softer shadow — see
444
+ * `LightingTuning.objectInfluence`. Omit for an exact shade of `intensity`
445
+ * tones. Must reference a color that is not a shadow or glow.
427
446
  */
428
447
  fg?: string;
429
448
  /**
430
- * Shadow intensity, 0-100.
449
+ * Tone step, 0–100: how many tones darker than `bg` the composite lands.
431
450
  * Supports [normal, highContrast] pair.
432
451
  */
433
452
  intensity: HCPair<number>;
@@ -446,6 +465,44 @@ interface ShadowColorDef {
446
465
  */
447
466
  inherit?: boolean;
448
467
  }
468
+ /**
469
+ * The mirror of {@link ShadowColorDef}: a translucent light overlay that lands
470
+ * the surface (`bg`) exactly `intensity` tones lighter in every scheme — for
471
+ * dark-mode elevation, edge highlights, and lightening state layers.
472
+ */
473
+ interface GlowColorDef {
474
+ type: 'glow';
475
+ /**
476
+ * The surface the glow falls on. Must reference a color that is not a
477
+ * shadow or glow.
478
+ */
479
+ bg: string;
480
+ /**
481
+ * The object emitting the glow. A lighter object glows stronger, a darker
482
+ * one weaker — see `LightingTuning.objectInfluence`. Omit for an exact tint
483
+ * of `intensity` tones. Must reference a color that is not a shadow or glow.
484
+ */
485
+ fg?: string;
486
+ /**
487
+ * Tone step, 0–100: how many tones lighter than `bg` the composite lands.
488
+ * Supports [normal, highContrast] pair.
489
+ */
490
+ intensity: HCPair<number>;
491
+ /** Override default tuning. Merged field-by-field with global `glowTuning`. */
492
+ tuning?: GlowTuning;
493
+ /**
494
+ * Per-color override for the hue-independent "safe" chroma limit used in
495
+ * OKHSL↔sRGB conversions (luminance, contrast solving, output formatting).
496
+ * Falls through to the per-theme / per-token `pastel` override when omitted.
497
+ * @see GlazeConfigOverride.pastel
498
+ */
499
+ pastel?: boolean;
500
+ /**
501
+ * Whether this color is inherited by child themes created via `extend()`.
502
+ * Default: true. Set to false to make this color local to the current theme.
503
+ */
504
+ inherit?: boolean;
505
+ }
449
506
  interface MixColorDef {
450
507
  type: 'mix';
451
508
  /** Background/base color name — the "from" color. */
@@ -467,9 +524,12 @@ interface MixColorDef {
467
524
  /**
468
525
  * Interpolation color space for opaque blending. Default: 'okhsl'.
469
526
  * - 'okhsl': perceptually uniform, consistent with Glaze's internal model.
470
- * - 'srgb': linear sRGB interpolation, matches browser compositing.
527
+ * - 'srgb': linear-light sRGB interpolation (like CSS
528
+ * `color-mix(in srgb-linear, …)`).
471
529
  *
472
- * Ignored for 'transparent' blend (always composites in linear sRGB).
530
+ * Ignored for 'transparent' blend: the browser composites that one, and
531
+ * its contrast solve models the browser (`source-over` on gamma-encoded
532
+ * sRGB).
473
533
  */
474
534
  space?: 'okhsl' | 'srgb';
475
535
  /**
@@ -499,7 +559,7 @@ interface MixColorDef {
499
559
  */
500
560
  inherit?: boolean;
501
561
  }
502
- type ColorDef = RegularColorDef | ShadowColorDef | MixColorDef;
562
+ type ColorDef = RegularColorDef | ShadowColorDef | GlowColorDef | MixColorDef;
503
563
  type ColorMap = Record<string, ColorDef>;
504
564
  /**
505
565
  * Resolved color for a single scheme variant.
@@ -531,7 +591,7 @@ interface ResolvedColor {
531
591
  dark: ResolvedColorVariant;
532
592
  lightContrast: ResolvedColorVariant;
533
593
  darkContrast: ResolvedColorVariant;
534
- /** Adaptation mode. Present only for regular colors, omitted for shadows. */
594
+ /** Adaptation mode of a regular color; `undefined` for shadow / glow / mix. */
535
595
  mode?: AdaptationMode;
536
596
  }
537
597
  /**
@@ -571,6 +631,8 @@ interface GlazeConfig {
571
631
  modes?: GlazeOutputModes;
572
632
  /** Default tuning for all shadow colors. Per-color tuning merges field-by-field. */
573
633
  shadowTuning?: ShadowTuning;
634
+ /** Default tuning for all glow colors. Per-color tuning merges field-by-field. */
635
+ glowTuning?: GlowTuning;
574
636
  /**
575
637
  * Manual contrast level — a 0–100 slider from normal contrast (`0`) to high
576
638
  * contrast (`100`), or `'auto'` (the default) to take the authored normal
@@ -590,7 +652,7 @@ interface GlazeConfig {
590
652
  * approximation, and a color keeps to one side of its base as the level moves.
591
653
  *
592
654
  * Pass `'auto'` to leave manual mode; `configure()` never clears a field by
593
- * omission. See `docs/api.md` for the ramp's edge cases (un-interpolable
655
+ * omission. See `docs/reference/contrast.md` for the ramp's edge cases (un-interpolable
594
656
  * pairs, side changes) and the export-freeze rule.
595
657
  *
596
658
  * @default 'auto'
@@ -629,6 +691,7 @@ interface GlazeConfigResolved {
629
691
  };
630
692
  modes: Required<GlazeOutputModes>;
631
693
  shadowTuning?: ShadowTuning;
694
+ glowTuning?: GlowTuning;
632
695
  autoFlip: boolean;
633
696
  /**
634
697
  * Manual contrast level (0–100) for the normal variants, or `'auto'` to take
@@ -690,12 +753,22 @@ interface GlazeConfigOverride {
690
753
  * standalone color tokens.
691
754
  */
692
755
  shadowTuning?: ShadowTuning;
756
+ /**
757
+ * Glow tuning defaults. Only meaningful for themes; harmless on
758
+ * standalone color tokens.
759
+ */
760
+ glowTuning?: GlowTuning;
693
761
  }
694
762
  /**
695
763
  * Current authoring-export schema version. Bump when the export shape
696
764
  * changes in a non-compatible way. Written on every `.export()` snapshot.
765
+ *
766
+ * - `1` — Glaze 2.x.
767
+ * - `2` — Glaze 3: `shadow` `intensity` / `fg` / `tuning` changed meaning and
768
+ * `glow` was added. Version-1 theme snapshots that carry shadow defs or a
769
+ * `shadowTuning` are rejected on restore.
697
770
  */
698
- declare const GLAZE_EXPORT_VERSION: 1;
771
+ declare const GLAZE_EXPORT_VERSION: 2;
699
772
  /** Literal type of {@link GLAZE_EXPORT_VERSION}. */
700
773
  type GlazeExportVersion = typeof GLAZE_EXPORT_VERSION;
701
774
  /** Discriminator for authoring export snapshots. */
@@ -720,24 +793,25 @@ interface GlazeThemeExport {
720
793
  */
721
794
  config?: GlazeConfigOverride;
722
795
  }
723
- /** Input for `glaze.shadow()` standalone factory. */
724
- interface GlazeShadowInput {
796
+ /** Input for the `glaze.shadow()` and `glaze.glow()` standalone factories. */
797
+ interface GlazeLightingInput {
725
798
  /**
726
- * Background color — accepts any `GlazeColorValue` form: hex
799
+ * The surface — accepts any `GlazeColorValue` form: hex
727
800
  * (`#rgb` / `#rrggbb` / `#rrggbbaa`), `rgb()` / `hsl()` / `okhsl()`
728
801
  * / `oklch()` strings, or literal objects (`{ r, g, b }`, `{ h, s, l }`,
729
802
  * `{ l, c, h }`). Alpha components are dropped with a warning.
730
803
  */
731
804
  bg: GlazeColorValue;
732
- /**
733
- * Foreground color for tinting + intensity modulation. Accepts the
734
- * same forms as `bg`.
735
- */
805
+ /** The object casting the shadow / emitting the glow. Same forms as `bg`. */
736
806
  fg?: GlazeColorValue;
737
- /** Intensity 0-100. */
807
+ /** Tone step, 0–100. */
738
808
  intensity: number;
739
- tuning?: ShadowTuning;
809
+ tuning?: LightingTuning;
740
810
  }
811
+ /** Input for `glaze.shadow()`. */
812
+ type GlazeShadowInput = GlazeLightingInput;
813
+ /** Input for `glaze.glow()`. */
814
+ type GlazeGlowInput = GlazeLightingInput;
741
815
  /** Input for the structured `glaze.color()` overload. */
742
816
  interface GlazeColorInput {
743
817
  hue: number;
@@ -1553,9 +1627,13 @@ type PaletteInput = Record<string, GlazeTheme>;
1553
1627
  * const primary = glaze({ hue: 280, saturation: 80, darkHue: 268, darkSaturation: 65 });
1554
1628
  * // with config override:
1555
1629
  * const raw = glaze(280, 80, { lightTone: false });
1630
+ * const rawSeed = glaze({ hue: 280, saturation: 80 }, { lightTone: false });
1556
1631
  * ```
1557
1632
  */
1558
- declare function glaze(hueOrOptions: number | GlazeThemeSeed, saturation?: number, config?: GlazeConfigOverride): GlazeTheme;
1633
+ declare function glaze(hue: number, saturation?: number, config?: GlazeConfigOverride): GlazeTheme;
1634
+ declare function glaze(seed: GlazeThemeSeed, config?: GlazeConfigOverride): GlazeTheme;
1635
+ /** @deprecated Pass the config second: `glaze(seed, config)`. */
1636
+ declare function glaze(seed: GlazeThemeSeed, saturation: undefined, config?: GlazeConfigOverride): GlazeTheme;
1559
1637
  declare namespace glaze {
1560
1638
  var configure: (config: GlazeConfig) => void;
1561
1639
  var palette: (themes: PaletteInput, options?: GlazePaletteOptions) => GlazePalette;
@@ -1563,6 +1641,7 @@ declare namespace glaze {
1563
1641
  var from: (data: GlazeThemeExport) => GlazeTheme;
1564
1642
  var color: (input: GlazeFromInput | GlazeColorInput | GlazeColorValue, config?: GlazeConfigOverride) => GlazeColorToken;
1565
1643
  var shadow: (input: GlazeShadowInput) => ResolvedColorVariant;
1644
+ var glow: (input: GlazeGlowInput) => ResolvedColorVariant;
1566
1645
  var format: (variant: ResolvedColorVariant, colorFormat?: GlazeColorFormat, pastel?: boolean) => string;
1567
1646
  var fromHex: (hex: string) => GlazeTheme;
1568
1647
  var fromRgb: (r: number, g: number, b: number) => GlazeTheme;
@@ -1583,7 +1662,7 @@ interface HueDeclaration {
1583
1662
  interface HuePlan {
1584
1663
  /** CSS `var()` reference spliced into `oklch(L C <hueVar>)`. */
1585
1664
  hueVar: string;
1586
- /** When true, emit a full inline color (shadow/mix/achromatic). */
1665
+ /** When true, emit a full inline color (shadow/glow/mix/achromatic). */
1587
1666
  inline: boolean;
1588
1667
  /** Scheme-independent `--*-hue` declarations for this color. */
1589
1668
  declarations: HueDeclaration[];
@@ -1844,5 +1923,5 @@ declare function srgbToHex(rgb: [number, number, number]): `#${string}`;
1844
1923
  */
1845
1924
  declare function okhslToOklch(h: number, s: number, l: number, pastel?: boolean): [number, number, number];
1846
1925
  //#endregion
1847
- export { APCA_HC_ENHANCEMENT, APCA_MAX_LC, APCA_PRESETS, type AdaptationMode, type ApcaPreset, type ChannelCtx, type ColorDef, type ColorMap, type ContrastPreset, type ContrastSpec, type DtcgColorSpace, type DtcgColorToken, type DtcgColorValue, type DtcgDocument, type DtcgOklchColorValue, type DtcgResolverModifier, type DtcgResolverRef, type DtcgResolverSet, type DtcgSrgbColorValue, type DtcgTokenTree, type ExtremeValue, type FindToneForContrastOptions, type FindToneForContrastResult, type FindValueForMixContrastOptions, type FindValueForMixContrastResult, GLAZE_EXPORT_VERSION, type GlazeColorCssOptions, type GlazeColorDtcgResolverOptions, type GlazeColorDtcgResult, type GlazeColorFormat, type GlazeColorInput, type GlazeColorInputExport, type GlazeColorOverrides, type GlazeColorOverridesExport, type GlazeColorTailwindOptions, type GlazeColorToken, type GlazeColorTokenExport, type GlazeColorValue, type GlazeConfig, type GlazeConfigOverride, type GlazeConfigResolved, type GlazeCssOptions, type GlazeCssResult, type GlazeDtcgOptions, type GlazeDtcgResolverContextNames, type GlazeDtcgResolverDocument, type GlazeDtcgResolverOptions, type GlazeDtcgResult, type GlazeExportKind, type GlazeExportVersion, type GlazeExtendOptions, type GlazeFromInput, type GlazeJsonOptions, type GlazeOutputModes, type GlazePalette, type GlazePaletteExport, type GlazePaletteExportOptions, type GlazePaletteOptions, type GlazeShadowInput, type GlazeTailwindOptions, type GlazeTheme, type GlazeThemeExport, type GlazeThemeSeed, type GlazeTokenOptions, type HCPair, type HexColor, type HueDeclaration, type HuePlan, type MinContrast, type MixColorDef, type OkhslColor, type OkhstColor, type OklchColor, type Polarity, REF_EPS, type RegularColorDef, type RelativeValue, type ResolvedColor, type ResolvedColorVariant, type ResolvedContrast, type RgbColor, type Role, type RoleInput, type ShadowColorDef, type ShadowTuning, type ToneValue, type ToneWindow, apcaContrast, assertAllPastel, assertNativeFormat, contrastRatioFromLuminance, cuspLightness, findToneForContrast, findValueForMixContrast, formatHsl, formatOkhsl, formatOkhst, formatOklch, formatRgb, fromTone, gamutClampedLuminance, glaze, hslToSrgb, inferRoleFromName, isColorTokenExport, isPaletteExport, isThemeExport, normalizeRole, okhslToLinearSrgb, okhslToOkhst, okhslToOklab, okhslToOklch, okhslToSrgb, okhstToOkhsl, oklabToOkhsl, oppositeRole, parseHex, parseHexAlpha, relativeLuminanceFromLinearRgb, resolveApcaTarget, resolveContrastForLevel, resolveContrastForMode, resolveMinContrast, roleToPolarity, srgbToHex, srgbToOkhsl, toTone, toneFromY, variantToOkhsl, yFromTone };
1926
+ export { APCA_HC_ENHANCEMENT, APCA_MAX_LC, APCA_PRESETS, type AdaptationMode, type ApcaPreset, type ChannelCtx, type ColorDef, type ColorMap, type ContrastPreset, type ContrastSpec, type DtcgColorSpace, type DtcgColorToken, type DtcgColorValue, type DtcgDocument, type DtcgOklchColorValue, type DtcgResolverModifier, type DtcgResolverRef, type DtcgResolverSet, type DtcgSrgbColorValue, type DtcgTokenTree, type ExtremeValue, type FindToneForContrastOptions, type FindToneForContrastResult, type FindValueForMixContrastOptions, type FindValueForMixContrastResult, GLAZE_EXPORT_VERSION, type GlazeColorCssOptions, type GlazeColorDtcgResolverOptions, type GlazeColorDtcgResult, type GlazeColorFormat, type GlazeColorInput, type GlazeColorInputExport, type GlazeColorOverrides, type GlazeColorOverridesExport, type GlazeColorTailwindOptions, type GlazeColorToken, type GlazeColorTokenExport, type GlazeColorValue, type GlazeConfig, type GlazeConfigOverride, type GlazeConfigResolved, type GlazeCssOptions, type GlazeCssResult, type GlazeDtcgOptions, type GlazeDtcgResolverContextNames, type GlazeDtcgResolverDocument, type GlazeDtcgResolverOptions, type GlazeDtcgResult, type GlazeExportKind, type GlazeExportVersion, type GlazeExtendOptions, type GlazeFromInput, type GlazeGlowInput, type GlazeJsonOptions, type GlazeLightingInput, type GlazeOutputModes, type GlazePalette, type GlazePaletteExport, type GlazePaletteExportOptions, type GlazePaletteOptions, type GlazeShadowInput, type GlazeTailwindOptions, type GlazeTheme, type GlazeThemeExport, type GlazeThemeSeed, type GlazeTokenOptions, type GlowColorDef, type GlowTuning, type HCPair, type HexColor, type HueDeclaration, type HuePlan, type LightingTuning, type MinContrast, type MixColorDef, type OkhslColor, type OkhstColor, type OklchColor, type Polarity, REF_EPS, type RegularColorDef, type RelativeValue, type ResolvedColor, type ResolvedColorVariant, type ResolvedContrast, type RgbColor, type Role, type RoleInput, type ShadowColorDef, type ShadowTuning, type ToneValue, type ToneWindow, apcaContrast, assertAllPastel, assertNativeFormat, contrastRatioFromLuminance, cuspLightness, findToneForContrast, findValueForMixContrast, formatHsl, formatOkhsl, formatOkhst, formatOklch, formatRgb, fromTone, gamutClampedLuminance, glaze, hslToSrgb, inferRoleFromName, isColorTokenExport, isPaletteExport, isThemeExport, normalizeRole, okhslToLinearSrgb, okhslToOkhst, okhslToOklab, okhslToOklch, okhslToSrgb, okhstToOkhsl, oklabToOkhsl, oppositeRole, parseHex, parseHexAlpha, relativeLuminanceFromLinearRgb, resolveApcaTarget, resolveContrastForLevel, resolveContrastForMode, resolveMinContrast, roleToPolarity, srgbToHex, srgbToOkhsl, toTone, toneFromY, variantToOkhsl, yFromTone };
1848
1927
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.mts CHANGED
@@ -296,7 +296,7 @@ interface RegularColorDef {
296
296
  */
297
297
  from?: GlazeColorValue;
298
298
  /**
299
- * Tone value (0–100, contrast-uniform — see `docs/okhst.md`).
299
+ * Tone value (0–100, contrast-uniform — see `docs/okhst.mdx`).
300
300
  * - Number: absolute tone.
301
301
  * - String ('+N' / '-N'): relative to base color's tone (requires `base`).
302
302
  * - `'max'` / `'min'`: force to the scheme's tone extreme (no base needed).
@@ -390,44 +390,63 @@ interface RegularColorDef {
390
390
  */
391
391
  inherit?: boolean;
392
392
  }
393
- /** Shadow tuning knobs. All values use the 0–1 scale (OKHSL). */
394
- interface ShadowTuning {
395
- /** Fraction of fg saturation kept in pigment (0-1). Default: 0.18. */
396
- saturationFactor?: number;
397
- /** Upper clamp on pigment saturation (0-1). Default: 0.25. */
398
- maxSaturation?: number;
399
- /** Multiplier for bg lightness → pigment lightness. Default: 0.25. */
400
- lightnessFactor?: number;
401
- /** [min, max] clamp for pigment lightness (0-1). Default: [0.05, 0.20]. */
402
- lightnessBounds?: [number, number];
393
+ /**
394
+ * Tuning shared by `shadow` and `glow`. Global defaults come from
395
+ * `shadowTuning` / `glowTuning`; a per-color `tuning` merges over them field
396
+ * by field.
397
+ */
398
+ interface LightingTuning {
403
399
  /**
404
- * Target minimum gap between pigment lightness and bg lightness (0-1).
405
- * Default: 0.05.
400
+ * β — how strongly the object (`fg`) scales the step. The step is
401
+ * `intensity × k` with `k = max(0, 1 + β · d · (t_bg − t_fg) / 100)`,
402
+ * `d = +1` for a shadow and `−1` for a glow: a darker object deepens its
403
+ * shadow, a lighter one strengthens its glow. An object at the surface's
404
+ * own tone (or no `fg`) gives exactly `intensity`. `0` ignores the object.
405
+ * Default: 0.5.
406
406
  */
407
- minGapTarget?: number;
408
- /** Max alpha (0-1). Reached at intensity=100 with max contrast. Default: 1.0. */
409
- alphaMax?: number;
407
+ objectInfluence?: number;
410
408
  /**
411
- * Blend weight (0-1) pulling pigment hue toward bg hue.
412
- * 0 = pure fg hue, 1 = pure bg hue. Default: 0.2.
409
+ * Pigment saturation (0–1) in the surface's hue. Default: 0 (neutral black /
410
+ * white). Shows only with `reach` below 1 — pure black and white have no hue.
413
411
  */
414
- bgHueBlend?: number;
412
+ tint?: number;
413
+ /**
414
+ * Where the pigment sits (0–1): the fraction of the way from the surface's
415
+ * tone to black (shadow) / white (glow). Default: 1 (pure black / white),
416
+ * the most reach. Lower values let a `tint` show at the cost of reach.
417
+ */
418
+ reach?: number;
419
+ /**
420
+ * Pull (0–1) of the pigment hue from the surface's hue toward the object's
421
+ * (`fg`) hue. Default: 0. Needs `fg`, a `tint`, and `reach` below 1 to show.
422
+ */
423
+ hueBleed?: number;
415
424
  }
425
+ /** Tuning for `shadow` colors. Same shape as {@link GlowTuning}. */
426
+ type ShadowTuning = LightingTuning;
427
+ /** Tuning for `glow` colors. Same shape as {@link ShadowTuning}. */
428
+ type GlowTuning = LightingTuning;
429
+ /**
430
+ * A translucent dark overlay that lands the surface (`bg`) exactly
431
+ * `intensity` tones darker in every scheme — a shade for state layers and
432
+ * scrims, or, with `fg`, an object-aware drop shadow.
433
+ */
416
434
  interface ShadowColorDef {
417
435
  type: 'shadow';
418
436
  /**
419
- * Background color name — the surface the shadow sits on.
420
- * Must reference a non-shadow color in the same theme.
437
+ * The surface the shadow falls on. Must reference a color that is not a
438
+ * shadow or glow.
421
439
  */
422
440
  bg: string;
423
441
  /**
424
- * Foreground color name for tinting and intensity modulation.
425
- * Must reference a non-shadow color in the same theme.
426
- * Omit for achromatic shadow at full user-specified intensity.
442
+ * The object casting the shadow (e.g. the card). A darker object casts a
443
+ * deeper shadow, a lighter one a softer shadow — see
444
+ * `LightingTuning.objectInfluence`. Omit for an exact shade of `intensity`
445
+ * tones. Must reference a color that is not a shadow or glow.
427
446
  */
428
447
  fg?: string;
429
448
  /**
430
- * Shadow intensity, 0-100.
449
+ * Tone step, 0–100: how many tones darker than `bg` the composite lands.
431
450
  * Supports [normal, highContrast] pair.
432
451
  */
433
452
  intensity: HCPair<number>;
@@ -446,6 +465,44 @@ interface ShadowColorDef {
446
465
  */
447
466
  inherit?: boolean;
448
467
  }
468
+ /**
469
+ * The mirror of {@link ShadowColorDef}: a translucent light overlay that lands
470
+ * the surface (`bg`) exactly `intensity` tones lighter in every scheme — for
471
+ * dark-mode elevation, edge highlights, and lightening state layers.
472
+ */
473
+ interface GlowColorDef {
474
+ type: 'glow';
475
+ /**
476
+ * The surface the glow falls on. Must reference a color that is not a
477
+ * shadow or glow.
478
+ */
479
+ bg: string;
480
+ /**
481
+ * The object emitting the glow. A lighter object glows stronger, a darker
482
+ * one weaker — see `LightingTuning.objectInfluence`. Omit for an exact tint
483
+ * of `intensity` tones. Must reference a color that is not a shadow or glow.
484
+ */
485
+ fg?: string;
486
+ /**
487
+ * Tone step, 0–100: how many tones lighter than `bg` the composite lands.
488
+ * Supports [normal, highContrast] pair.
489
+ */
490
+ intensity: HCPair<number>;
491
+ /** Override default tuning. Merged field-by-field with global `glowTuning`. */
492
+ tuning?: GlowTuning;
493
+ /**
494
+ * Per-color override for the hue-independent "safe" chroma limit used in
495
+ * OKHSL↔sRGB conversions (luminance, contrast solving, output formatting).
496
+ * Falls through to the per-theme / per-token `pastel` override when omitted.
497
+ * @see GlazeConfigOverride.pastel
498
+ */
499
+ pastel?: boolean;
500
+ /**
501
+ * Whether this color is inherited by child themes created via `extend()`.
502
+ * Default: true. Set to false to make this color local to the current theme.
503
+ */
504
+ inherit?: boolean;
505
+ }
449
506
  interface MixColorDef {
450
507
  type: 'mix';
451
508
  /** Background/base color name — the "from" color. */
@@ -467,9 +524,12 @@ interface MixColorDef {
467
524
  /**
468
525
  * Interpolation color space for opaque blending. Default: 'okhsl'.
469
526
  * - 'okhsl': perceptually uniform, consistent with Glaze's internal model.
470
- * - 'srgb': linear sRGB interpolation, matches browser compositing.
527
+ * - 'srgb': linear-light sRGB interpolation (like CSS
528
+ * `color-mix(in srgb-linear, …)`).
471
529
  *
472
- * Ignored for 'transparent' blend (always composites in linear sRGB).
530
+ * Ignored for 'transparent' blend: the browser composites that one, and
531
+ * its contrast solve models the browser (`source-over` on gamma-encoded
532
+ * sRGB).
473
533
  */
474
534
  space?: 'okhsl' | 'srgb';
475
535
  /**
@@ -499,7 +559,7 @@ interface MixColorDef {
499
559
  */
500
560
  inherit?: boolean;
501
561
  }
502
- type ColorDef = RegularColorDef | ShadowColorDef | MixColorDef;
562
+ type ColorDef = RegularColorDef | ShadowColorDef | GlowColorDef | MixColorDef;
503
563
  type ColorMap = Record<string, ColorDef>;
504
564
  /**
505
565
  * Resolved color for a single scheme variant.
@@ -531,7 +591,7 @@ interface ResolvedColor {
531
591
  dark: ResolvedColorVariant;
532
592
  lightContrast: ResolvedColorVariant;
533
593
  darkContrast: ResolvedColorVariant;
534
- /** Adaptation mode. Present only for regular colors, omitted for shadows. */
594
+ /** Adaptation mode of a regular color; `undefined` for shadow / glow / mix. */
535
595
  mode?: AdaptationMode;
536
596
  }
537
597
  /**
@@ -571,6 +631,8 @@ interface GlazeConfig {
571
631
  modes?: GlazeOutputModes;
572
632
  /** Default tuning for all shadow colors. Per-color tuning merges field-by-field. */
573
633
  shadowTuning?: ShadowTuning;
634
+ /** Default tuning for all glow colors. Per-color tuning merges field-by-field. */
635
+ glowTuning?: GlowTuning;
574
636
  /**
575
637
  * Manual contrast level — a 0–100 slider from normal contrast (`0`) to high
576
638
  * contrast (`100`), or `'auto'` (the default) to take the authored normal
@@ -590,7 +652,7 @@ interface GlazeConfig {
590
652
  * approximation, and a color keeps to one side of its base as the level moves.
591
653
  *
592
654
  * Pass `'auto'` to leave manual mode; `configure()` never clears a field by
593
- * omission. See `docs/api.md` for the ramp's edge cases (un-interpolable
655
+ * omission. See `docs/reference/contrast.md` for the ramp's edge cases (un-interpolable
594
656
  * pairs, side changes) and the export-freeze rule.
595
657
  *
596
658
  * @default 'auto'
@@ -629,6 +691,7 @@ interface GlazeConfigResolved {
629
691
  };
630
692
  modes: Required<GlazeOutputModes>;
631
693
  shadowTuning?: ShadowTuning;
694
+ glowTuning?: GlowTuning;
632
695
  autoFlip: boolean;
633
696
  /**
634
697
  * Manual contrast level (0–100) for the normal variants, or `'auto'` to take
@@ -690,12 +753,22 @@ interface GlazeConfigOverride {
690
753
  * standalone color tokens.
691
754
  */
692
755
  shadowTuning?: ShadowTuning;
756
+ /**
757
+ * Glow tuning defaults. Only meaningful for themes; harmless on
758
+ * standalone color tokens.
759
+ */
760
+ glowTuning?: GlowTuning;
693
761
  }
694
762
  /**
695
763
  * Current authoring-export schema version. Bump when the export shape
696
764
  * changes in a non-compatible way. Written on every `.export()` snapshot.
765
+ *
766
+ * - `1` — Glaze 2.x.
767
+ * - `2` — Glaze 3: `shadow` `intensity` / `fg` / `tuning` changed meaning and
768
+ * `glow` was added. Version-1 theme snapshots that carry shadow defs or a
769
+ * `shadowTuning` are rejected on restore.
697
770
  */
698
- declare const GLAZE_EXPORT_VERSION: 1;
771
+ declare const GLAZE_EXPORT_VERSION: 2;
699
772
  /** Literal type of {@link GLAZE_EXPORT_VERSION}. */
700
773
  type GlazeExportVersion = typeof GLAZE_EXPORT_VERSION;
701
774
  /** Discriminator for authoring export snapshots. */
@@ -720,24 +793,25 @@ interface GlazeThemeExport {
720
793
  */
721
794
  config?: GlazeConfigOverride;
722
795
  }
723
- /** Input for `glaze.shadow()` standalone factory. */
724
- interface GlazeShadowInput {
796
+ /** Input for the `glaze.shadow()` and `glaze.glow()` standalone factories. */
797
+ interface GlazeLightingInput {
725
798
  /**
726
- * Background color — accepts any `GlazeColorValue` form: hex
799
+ * The surface — accepts any `GlazeColorValue` form: hex
727
800
  * (`#rgb` / `#rrggbb` / `#rrggbbaa`), `rgb()` / `hsl()` / `okhsl()`
728
801
  * / `oklch()` strings, or literal objects (`{ r, g, b }`, `{ h, s, l }`,
729
802
  * `{ l, c, h }`). Alpha components are dropped with a warning.
730
803
  */
731
804
  bg: GlazeColorValue;
732
- /**
733
- * Foreground color for tinting + intensity modulation. Accepts the
734
- * same forms as `bg`.
735
- */
805
+ /** The object casting the shadow / emitting the glow. Same forms as `bg`. */
736
806
  fg?: GlazeColorValue;
737
- /** Intensity 0-100. */
807
+ /** Tone step, 0–100. */
738
808
  intensity: number;
739
- tuning?: ShadowTuning;
809
+ tuning?: LightingTuning;
740
810
  }
811
+ /** Input for `glaze.shadow()`. */
812
+ type GlazeShadowInput = GlazeLightingInput;
813
+ /** Input for `glaze.glow()`. */
814
+ type GlazeGlowInput = GlazeLightingInput;
741
815
  /** Input for the structured `glaze.color()` overload. */
742
816
  interface GlazeColorInput {
743
817
  hue: number;
@@ -1553,9 +1627,13 @@ type PaletteInput = Record<string, GlazeTheme>;
1553
1627
  * const primary = glaze({ hue: 280, saturation: 80, darkHue: 268, darkSaturation: 65 });
1554
1628
  * // with config override:
1555
1629
  * const raw = glaze(280, 80, { lightTone: false });
1630
+ * const rawSeed = glaze({ hue: 280, saturation: 80 }, { lightTone: false });
1556
1631
  * ```
1557
1632
  */
1558
- declare function glaze(hueOrOptions: number | GlazeThemeSeed, saturation?: number, config?: GlazeConfigOverride): GlazeTheme;
1633
+ declare function glaze(hue: number, saturation?: number, config?: GlazeConfigOverride): GlazeTheme;
1634
+ declare function glaze(seed: GlazeThemeSeed, config?: GlazeConfigOverride): GlazeTheme;
1635
+ /** @deprecated Pass the config second: `glaze(seed, config)`. */
1636
+ declare function glaze(seed: GlazeThemeSeed, saturation: undefined, config?: GlazeConfigOverride): GlazeTheme;
1559
1637
  declare namespace glaze {
1560
1638
  var configure: (config: GlazeConfig) => void;
1561
1639
  var palette: (themes: PaletteInput, options?: GlazePaletteOptions) => GlazePalette;
@@ -1563,6 +1641,7 @@ declare namespace glaze {
1563
1641
  var from: (data: GlazeThemeExport) => GlazeTheme;
1564
1642
  var color: (input: GlazeFromInput | GlazeColorInput | GlazeColorValue, config?: GlazeConfigOverride) => GlazeColorToken;
1565
1643
  var shadow: (input: GlazeShadowInput) => ResolvedColorVariant;
1644
+ var glow: (input: GlazeGlowInput) => ResolvedColorVariant;
1566
1645
  var format: (variant: ResolvedColorVariant, colorFormat?: GlazeColorFormat, pastel?: boolean) => string;
1567
1646
  var fromHex: (hex: string) => GlazeTheme;
1568
1647
  var fromRgb: (r: number, g: number, b: number) => GlazeTheme;
@@ -1583,7 +1662,7 @@ interface HueDeclaration {
1583
1662
  interface HuePlan {
1584
1663
  /** CSS `var()` reference spliced into `oklch(L C <hueVar>)`. */
1585
1664
  hueVar: string;
1586
- /** When true, emit a full inline color (shadow/mix/achromatic). */
1665
+ /** When true, emit a full inline color (shadow/glow/mix/achromatic). */
1587
1666
  inline: boolean;
1588
1667
  /** Scheme-independent `--*-hue` declarations for this color. */
1589
1668
  declarations: HueDeclaration[];
@@ -1844,5 +1923,5 @@ declare function srgbToHex(rgb: [number, number, number]): `#${string}`;
1844
1923
  */
1845
1924
  declare function okhslToOklch(h: number, s: number, l: number, pastel?: boolean): [number, number, number];
1846
1925
  //#endregion
1847
- export { APCA_HC_ENHANCEMENT, APCA_MAX_LC, APCA_PRESETS, type AdaptationMode, type ApcaPreset, type ChannelCtx, type ColorDef, type ColorMap, type ContrastPreset, type ContrastSpec, type DtcgColorSpace, type DtcgColorToken, type DtcgColorValue, type DtcgDocument, type DtcgOklchColorValue, type DtcgResolverModifier, type DtcgResolverRef, type DtcgResolverSet, type DtcgSrgbColorValue, type DtcgTokenTree, type ExtremeValue, type FindToneForContrastOptions, type FindToneForContrastResult, type FindValueForMixContrastOptions, type FindValueForMixContrastResult, GLAZE_EXPORT_VERSION, type GlazeColorCssOptions, type GlazeColorDtcgResolverOptions, type GlazeColorDtcgResult, type GlazeColorFormat, type GlazeColorInput, type GlazeColorInputExport, type GlazeColorOverrides, type GlazeColorOverridesExport, type GlazeColorTailwindOptions, type GlazeColorToken, type GlazeColorTokenExport, type GlazeColorValue, type GlazeConfig, type GlazeConfigOverride, type GlazeConfigResolved, type GlazeCssOptions, type GlazeCssResult, type GlazeDtcgOptions, type GlazeDtcgResolverContextNames, type GlazeDtcgResolverDocument, type GlazeDtcgResolverOptions, type GlazeDtcgResult, type GlazeExportKind, type GlazeExportVersion, type GlazeExtendOptions, type GlazeFromInput, type GlazeJsonOptions, type GlazeOutputModes, type GlazePalette, type GlazePaletteExport, type GlazePaletteExportOptions, type GlazePaletteOptions, type GlazeShadowInput, type GlazeTailwindOptions, type GlazeTheme, type GlazeThemeExport, type GlazeThemeSeed, type GlazeTokenOptions, type HCPair, type HexColor, type HueDeclaration, type HuePlan, type MinContrast, type MixColorDef, type OkhslColor, type OkhstColor, type OklchColor, type Polarity, REF_EPS, type RegularColorDef, type RelativeValue, type ResolvedColor, type ResolvedColorVariant, type ResolvedContrast, type RgbColor, type Role, type RoleInput, type ShadowColorDef, type ShadowTuning, type ToneValue, type ToneWindow, apcaContrast, assertAllPastel, assertNativeFormat, contrastRatioFromLuminance, cuspLightness, findToneForContrast, findValueForMixContrast, formatHsl, formatOkhsl, formatOkhst, formatOklch, formatRgb, fromTone, gamutClampedLuminance, glaze, hslToSrgb, inferRoleFromName, isColorTokenExport, isPaletteExport, isThemeExport, normalizeRole, okhslToLinearSrgb, okhslToOkhst, okhslToOklab, okhslToOklch, okhslToSrgb, okhstToOkhsl, oklabToOkhsl, oppositeRole, parseHex, parseHexAlpha, relativeLuminanceFromLinearRgb, resolveApcaTarget, resolveContrastForLevel, resolveContrastForMode, resolveMinContrast, roleToPolarity, srgbToHex, srgbToOkhsl, toTone, toneFromY, variantToOkhsl, yFromTone };
1926
+ export { APCA_HC_ENHANCEMENT, APCA_MAX_LC, APCA_PRESETS, type AdaptationMode, type ApcaPreset, type ChannelCtx, type ColorDef, type ColorMap, type ContrastPreset, type ContrastSpec, type DtcgColorSpace, type DtcgColorToken, type DtcgColorValue, type DtcgDocument, type DtcgOklchColorValue, type DtcgResolverModifier, type DtcgResolverRef, type DtcgResolverSet, type DtcgSrgbColorValue, type DtcgTokenTree, type ExtremeValue, type FindToneForContrastOptions, type FindToneForContrastResult, type FindValueForMixContrastOptions, type FindValueForMixContrastResult, GLAZE_EXPORT_VERSION, type GlazeColorCssOptions, type GlazeColorDtcgResolverOptions, type GlazeColorDtcgResult, type GlazeColorFormat, type GlazeColorInput, type GlazeColorInputExport, type GlazeColorOverrides, type GlazeColorOverridesExport, type GlazeColorTailwindOptions, type GlazeColorToken, type GlazeColorTokenExport, type GlazeColorValue, type GlazeConfig, type GlazeConfigOverride, type GlazeConfigResolved, type GlazeCssOptions, type GlazeCssResult, type GlazeDtcgOptions, type GlazeDtcgResolverContextNames, type GlazeDtcgResolverDocument, type GlazeDtcgResolverOptions, type GlazeDtcgResult, type GlazeExportKind, type GlazeExportVersion, type GlazeExtendOptions, type GlazeFromInput, type GlazeGlowInput, type GlazeJsonOptions, type GlazeLightingInput, type GlazeOutputModes, type GlazePalette, type GlazePaletteExport, type GlazePaletteExportOptions, type GlazePaletteOptions, type GlazeShadowInput, type GlazeTailwindOptions, type GlazeTheme, type GlazeThemeExport, type GlazeThemeSeed, type GlazeTokenOptions, type GlowColorDef, type GlowTuning, type HCPair, type HexColor, type HueDeclaration, type HuePlan, type LightingTuning, type MinContrast, type MixColorDef, type OkhslColor, type OkhstColor, type OklchColor, type Polarity, REF_EPS, type RegularColorDef, type RelativeValue, type ResolvedColor, type ResolvedColorVariant, type ResolvedContrast, type RgbColor, type Role, type RoleInput, type ShadowColorDef, type ShadowTuning, type ToneValue, type ToneWindow, apcaContrast, assertAllPastel, assertNativeFormat, contrastRatioFromLuminance, cuspLightness, findToneForContrast, findValueForMixContrast, formatHsl, formatOkhsl, formatOkhst, formatOklch, formatRgb, fromTone, gamutClampedLuminance, glaze, hslToSrgb, inferRoleFromName, isColorTokenExport, isPaletteExport, isThemeExport, normalizeRole, okhslToLinearSrgb, okhslToOkhst, okhslToOklab, okhslToOklch, okhslToSrgb, okhstToOkhsl, oklabToOkhsl, oppositeRole, parseHex, parseHexAlpha, relativeLuminanceFromLinearRgb, resolveApcaTarget, resolveContrastForLevel, resolveContrastForMode, resolveMinContrast, roleToPolarity, srgbToHex, srgbToOkhsl, toTone, toneFromY, variantToOkhsl, yFromTone };
1848
1927
  //# sourceMappingURL=index.d.mts.map