@tenphi/glaze 1.2.0 → 1.3.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/README.md +1 -0
- package/dist/index.cjs +270 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +86 -3
- package/dist/index.d.mts +86 -3
- package/dist/index.mjs +270 -41
- package/dist/index.mjs.map +1 -1
- package/docs/api.md +156 -8
- package/docs/methodology.md +21 -1
- package/docs/okhst.md +13 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -62,6 +62,24 @@ declare function resolveMinContrast(value: MinContrast$1): number;
|
|
|
62
62
|
* selected spec rather than an outer pair).
|
|
63
63
|
*/
|
|
64
64
|
declare function resolveContrastForMode(spec: ContrastSpec, isHighContrast: boolean, polarity?: 'fg' | 'bg', outerExplicitHC?: boolean): ResolvedContrast;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve a `contrast` spec — including its outer `[normal, highContrast]`
|
|
67
|
+
* pair — at a manual contrast `level` (0–100), by resolving both ends and
|
|
68
|
+
* interpolating the numeric target.
|
|
69
|
+
*
|
|
70
|
+
* Level 0 / 100 delegate verbatim to {@link resolveContrastForMode}, so the
|
|
71
|
+
* endpoints are bit-identical to classic normal / high-contrast resolution.
|
|
72
|
+
* Resolving each end fully first also means every rule that governs the
|
|
73
|
+
* escalation still applies at both ends for free: preset mapping, the
|
|
74
|
+
* `APCA_MAX_LC` clamp, and the explicit-HC suppression that cancels the
|
|
75
|
+
* `AA → AAA` promotion and the `+15 Lc` enhancement.
|
|
76
|
+
*
|
|
77
|
+
* Throws when the two ends measure in different metrics — a WCAG ratio and an
|
|
78
|
+
* APCA Lc live on different scales, so there is no target between them. Such a
|
|
79
|
+
* pair is rejected at authoring time by `validateColorDefs`; this is the guard
|
|
80
|
+
* for direct callers.
|
|
81
|
+
*/
|
|
82
|
+
declare function resolveContrastForLevel(spec: HCPair<ContrastSpec>, level: number, polarity?: 'fg' | 'bg'): ResolvedContrast;
|
|
65
83
|
/**
|
|
66
84
|
* APCA lightness contrast (Lc), signed: positive for dark text on light bg,
|
|
67
85
|
* negative for light text on dark bg. Inputs are screen luminances (0–1).
|
|
@@ -88,6 +106,19 @@ interface FindToneForContrastOptions {
|
|
|
88
106
|
initialDirection?: 'lighter' | 'darker';
|
|
89
107
|
/** Auto-flip tone direction when contrast can't be met. Default: false. */
|
|
90
108
|
flip?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* When `flip` is on and *both* directions meet the target, keep
|
|
111
|
+
* `initialDirection` instead of taking whichever result lands nearer the
|
|
112
|
+
* preferred tone. Default: false (nearest wins).
|
|
113
|
+
*
|
|
114
|
+
* The nearest-wins tie-break is unstable along a ramp of targets: which side
|
|
115
|
+
* is nearer shifts as the target grows, so a color can swap sides between two
|
|
116
|
+
* adjacent targets. Set this when a caller needs the side to be a property of
|
|
117
|
+
* the color rather than of the target — the manual contrast level does. The
|
|
118
|
+
* flip itself is unaffected: an initial direction that cannot reach the
|
|
119
|
+
* target still falls back to the opposite side.
|
|
120
|
+
*/
|
|
121
|
+
preferInitial?: boolean;
|
|
91
122
|
/** Use the hue-independent "safe" chroma boundary. Default: false. */
|
|
92
123
|
pastel?: boolean;
|
|
93
124
|
}
|
|
@@ -200,7 +231,14 @@ type GlazeColorFormat = 'okhsl' | 'okhst' | 'rgb' | 'hsl' | 'oklch';
|
|
|
200
231
|
interface GlazeOutputModes {
|
|
201
232
|
/** Include dark scheme variants. Default: true. */
|
|
202
233
|
dark?: boolean;
|
|
203
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* Include high-contrast variants (both light-HC and dark-HC). Default: false.
|
|
236
|
+
*
|
|
237
|
+
* Inert while a global `contrastLevel` is set: a manual level has no separate
|
|
238
|
+
* high-contrast tier, so this reads as "emit high-contrast variants when
|
|
239
|
+
* contrast is automatic".
|
|
240
|
+
* @see GlazeConfig.contrastLevel
|
|
241
|
+
*/
|
|
204
242
|
highContrast?: boolean;
|
|
205
243
|
}
|
|
206
244
|
/** Hex color string for DX hints. Runtime validation in `parseHex()`. */
|
|
@@ -495,10 +533,38 @@ interface GlazeConfig {
|
|
|
495
533
|
dark?: string;
|
|
496
534
|
highContrast?: string;
|
|
497
535
|
};
|
|
498
|
-
/**
|
|
536
|
+
/**
|
|
537
|
+
* Which scheme variants to include in exports. Defaults: `dark: true`,
|
|
538
|
+
* `highContrast: false`.
|
|
539
|
+
*/
|
|
499
540
|
modes?: GlazeOutputModes;
|
|
500
541
|
/** Default tuning for all shadow colors. Per-color tuning merges field-by-field. */
|
|
501
542
|
shadowTuning?: ShadowTuning;
|
|
543
|
+
/**
|
|
544
|
+
* Manual contrast level — a 0–100 slider from normal contrast (`0`) to high
|
|
545
|
+
* contrast (`100`), or `'auto'` (the default) to keep the two-tier
|
|
546
|
+
* normal + high-contrast model.
|
|
547
|
+
*
|
|
548
|
+
* With a number, Glaze resolves the `light` / `dark` variants *at* that
|
|
549
|
+
* level and stops emitting a separate high-contrast tier:
|
|
550
|
+
* `lightContrast` / `darkContrast` mirror their normal counterparts and
|
|
551
|
+
* `modes.highContrast` defaults to `false`. Level `0` is therefore "normal
|
|
552
|
+
* contrast, no high-contrast tier"; `100` is "the high-contrast scheme as
|
|
553
|
+
* the only scheme".
|
|
554
|
+
*
|
|
555
|
+
* The level interpolates all three things that make high contrast differ:
|
|
556
|
+
* authored `[normal, highContrast]` pairs, the tone-window widening, and
|
|
557
|
+
* the `AA → AAA` / APCA `+15 Lc` escalation. Contrast floors are re-solved
|
|
558
|
+
* at the interpolated target, so every level is a solution rather than an
|
|
559
|
+
* approximation, and a color keeps to one side of its base as the level moves.
|
|
560
|
+
*
|
|
561
|
+
* Pass `'auto'` to leave manual mode; `configure()` never clears a field by
|
|
562
|
+
* omission. See `docs/api.md` for the ramp's edge cases (un-interpolable
|
|
563
|
+
* pairs, side changes) and the export-freeze rule.
|
|
564
|
+
*
|
|
565
|
+
* @default 'auto'
|
|
566
|
+
*/
|
|
567
|
+
contrastLevel?: number | 'auto';
|
|
502
568
|
/**
|
|
503
569
|
* Automatically flip tone direction when contrast can't be met.
|
|
504
570
|
*
|
|
@@ -533,6 +599,12 @@ interface GlazeConfigResolved {
|
|
|
533
599
|
modes: Required<GlazeOutputModes>;
|
|
534
600
|
shadowTuning?: ShadowTuning;
|
|
535
601
|
autoFlip: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* Manual contrast level (0–100), or `'auto'` for the two-tier
|
|
604
|
+
* normal + high-contrast model.
|
|
605
|
+
* @see GlazeConfig.contrastLevel
|
|
606
|
+
*/
|
|
607
|
+
contrastLevel: number | 'auto';
|
|
536
608
|
/**
|
|
537
609
|
* Instance-level pastel default (`def.pastel ?? config.pastel`).
|
|
538
610
|
* Not set via `glaze.configure()` — only via per-theme / per-token
|
|
@@ -558,6 +630,17 @@ interface GlazeConfigOverride {
|
|
|
558
630
|
darkDesaturation?: number;
|
|
559
631
|
/** Whether to auto-flip tone when contrast can't be met. */
|
|
560
632
|
autoFlip?: boolean;
|
|
633
|
+
/**
|
|
634
|
+
* Manual contrast level (0–100) for this instance, or `'auto'` to opt out
|
|
635
|
+
* of a global level and keep the two-tier normal + high-contrast model.
|
|
636
|
+
*
|
|
637
|
+
* Only an instance-authored level is frozen into `.export()` snapshots — a
|
|
638
|
+
* level inherited from the global config is treated as a live preference and
|
|
639
|
+
* re-read at restore time.
|
|
640
|
+
*
|
|
641
|
+
* @see GlazeConfig.contrastLevel
|
|
642
|
+
*/
|
|
643
|
+
contrastLevel?: number | 'auto';
|
|
561
644
|
/**
|
|
562
645
|
* Instance-level pastel default for colors that omit per-color `pastel`.
|
|
563
646
|
* Not available on `glaze.configure()` — set here or per-color.
|
|
@@ -1723,5 +1806,5 @@ declare function srgbToHex(rgb: [number, number, number]): `#${string}`;
|
|
|
1723
1806
|
*/
|
|
1724
1807
|
declare function okhslToOklch(h: number, s: number, l: number, pastel?: boolean): [number, number, number];
|
|
1725
1808
|
//#endregion
|
|
1726
|
-
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, resolveContrastForMode, resolveMinContrast, roleToPolarity, srgbToHex, srgbToOkhsl, toTone, toneFromY, variantToOkhsl, yFromTone };
|
|
1809
|
+
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 };
|
|
1727
1810
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -62,6 +62,24 @@ declare function resolveMinContrast(value: MinContrast$1): number;
|
|
|
62
62
|
* selected spec rather than an outer pair).
|
|
63
63
|
*/
|
|
64
64
|
declare function resolveContrastForMode(spec: ContrastSpec, isHighContrast: boolean, polarity?: 'fg' | 'bg', outerExplicitHC?: boolean): ResolvedContrast;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve a `contrast` spec — including its outer `[normal, highContrast]`
|
|
67
|
+
* pair — at a manual contrast `level` (0–100), by resolving both ends and
|
|
68
|
+
* interpolating the numeric target.
|
|
69
|
+
*
|
|
70
|
+
* Level 0 / 100 delegate verbatim to {@link resolveContrastForMode}, so the
|
|
71
|
+
* endpoints are bit-identical to classic normal / high-contrast resolution.
|
|
72
|
+
* Resolving each end fully first also means every rule that governs the
|
|
73
|
+
* escalation still applies at both ends for free: preset mapping, the
|
|
74
|
+
* `APCA_MAX_LC` clamp, and the explicit-HC suppression that cancels the
|
|
75
|
+
* `AA → AAA` promotion and the `+15 Lc` enhancement.
|
|
76
|
+
*
|
|
77
|
+
* Throws when the two ends measure in different metrics — a WCAG ratio and an
|
|
78
|
+
* APCA Lc live on different scales, so there is no target between them. Such a
|
|
79
|
+
* pair is rejected at authoring time by `validateColorDefs`; this is the guard
|
|
80
|
+
* for direct callers.
|
|
81
|
+
*/
|
|
82
|
+
declare function resolveContrastForLevel(spec: HCPair<ContrastSpec>, level: number, polarity?: 'fg' | 'bg'): ResolvedContrast;
|
|
65
83
|
/**
|
|
66
84
|
* APCA lightness contrast (Lc), signed: positive for dark text on light bg,
|
|
67
85
|
* negative for light text on dark bg. Inputs are screen luminances (0–1).
|
|
@@ -88,6 +106,19 @@ interface FindToneForContrastOptions {
|
|
|
88
106
|
initialDirection?: 'lighter' | 'darker';
|
|
89
107
|
/** Auto-flip tone direction when contrast can't be met. Default: false. */
|
|
90
108
|
flip?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* When `flip` is on and *both* directions meet the target, keep
|
|
111
|
+
* `initialDirection` instead of taking whichever result lands nearer the
|
|
112
|
+
* preferred tone. Default: false (nearest wins).
|
|
113
|
+
*
|
|
114
|
+
* The nearest-wins tie-break is unstable along a ramp of targets: which side
|
|
115
|
+
* is nearer shifts as the target grows, so a color can swap sides between two
|
|
116
|
+
* adjacent targets. Set this when a caller needs the side to be a property of
|
|
117
|
+
* the color rather than of the target — the manual contrast level does. The
|
|
118
|
+
* flip itself is unaffected: an initial direction that cannot reach the
|
|
119
|
+
* target still falls back to the opposite side.
|
|
120
|
+
*/
|
|
121
|
+
preferInitial?: boolean;
|
|
91
122
|
/** Use the hue-independent "safe" chroma boundary. Default: false. */
|
|
92
123
|
pastel?: boolean;
|
|
93
124
|
}
|
|
@@ -200,7 +231,14 @@ type GlazeColorFormat = 'okhsl' | 'okhst' | 'rgb' | 'hsl' | 'oklch';
|
|
|
200
231
|
interface GlazeOutputModes {
|
|
201
232
|
/** Include dark scheme variants. Default: true. */
|
|
202
233
|
dark?: boolean;
|
|
203
|
-
/**
|
|
234
|
+
/**
|
|
235
|
+
* Include high-contrast variants (both light-HC and dark-HC). Default: false.
|
|
236
|
+
*
|
|
237
|
+
* Inert while a global `contrastLevel` is set: a manual level has no separate
|
|
238
|
+
* high-contrast tier, so this reads as "emit high-contrast variants when
|
|
239
|
+
* contrast is automatic".
|
|
240
|
+
* @see GlazeConfig.contrastLevel
|
|
241
|
+
*/
|
|
204
242
|
highContrast?: boolean;
|
|
205
243
|
}
|
|
206
244
|
/** Hex color string for DX hints. Runtime validation in `parseHex()`. */
|
|
@@ -495,10 +533,38 @@ interface GlazeConfig {
|
|
|
495
533
|
dark?: string;
|
|
496
534
|
highContrast?: string;
|
|
497
535
|
};
|
|
498
|
-
/**
|
|
536
|
+
/**
|
|
537
|
+
* Which scheme variants to include in exports. Defaults: `dark: true`,
|
|
538
|
+
* `highContrast: false`.
|
|
539
|
+
*/
|
|
499
540
|
modes?: GlazeOutputModes;
|
|
500
541
|
/** Default tuning for all shadow colors. Per-color tuning merges field-by-field. */
|
|
501
542
|
shadowTuning?: ShadowTuning;
|
|
543
|
+
/**
|
|
544
|
+
* Manual contrast level — a 0–100 slider from normal contrast (`0`) to high
|
|
545
|
+
* contrast (`100`), or `'auto'` (the default) to keep the two-tier
|
|
546
|
+
* normal + high-contrast model.
|
|
547
|
+
*
|
|
548
|
+
* With a number, Glaze resolves the `light` / `dark` variants *at* that
|
|
549
|
+
* level and stops emitting a separate high-contrast tier:
|
|
550
|
+
* `lightContrast` / `darkContrast` mirror their normal counterparts and
|
|
551
|
+
* `modes.highContrast` defaults to `false`. Level `0` is therefore "normal
|
|
552
|
+
* contrast, no high-contrast tier"; `100` is "the high-contrast scheme as
|
|
553
|
+
* the only scheme".
|
|
554
|
+
*
|
|
555
|
+
* The level interpolates all three things that make high contrast differ:
|
|
556
|
+
* authored `[normal, highContrast]` pairs, the tone-window widening, and
|
|
557
|
+
* the `AA → AAA` / APCA `+15 Lc` escalation. Contrast floors are re-solved
|
|
558
|
+
* at the interpolated target, so every level is a solution rather than an
|
|
559
|
+
* approximation, and a color keeps to one side of its base as the level moves.
|
|
560
|
+
*
|
|
561
|
+
* Pass `'auto'` to leave manual mode; `configure()` never clears a field by
|
|
562
|
+
* omission. See `docs/api.md` for the ramp's edge cases (un-interpolable
|
|
563
|
+
* pairs, side changes) and the export-freeze rule.
|
|
564
|
+
*
|
|
565
|
+
* @default 'auto'
|
|
566
|
+
*/
|
|
567
|
+
contrastLevel?: number | 'auto';
|
|
502
568
|
/**
|
|
503
569
|
* Automatically flip tone direction when contrast can't be met.
|
|
504
570
|
*
|
|
@@ -533,6 +599,12 @@ interface GlazeConfigResolved {
|
|
|
533
599
|
modes: Required<GlazeOutputModes>;
|
|
534
600
|
shadowTuning?: ShadowTuning;
|
|
535
601
|
autoFlip: boolean;
|
|
602
|
+
/**
|
|
603
|
+
* Manual contrast level (0–100), or `'auto'` for the two-tier
|
|
604
|
+
* normal + high-contrast model.
|
|
605
|
+
* @see GlazeConfig.contrastLevel
|
|
606
|
+
*/
|
|
607
|
+
contrastLevel: number | 'auto';
|
|
536
608
|
/**
|
|
537
609
|
* Instance-level pastel default (`def.pastel ?? config.pastel`).
|
|
538
610
|
* Not set via `glaze.configure()` — only via per-theme / per-token
|
|
@@ -558,6 +630,17 @@ interface GlazeConfigOverride {
|
|
|
558
630
|
darkDesaturation?: number;
|
|
559
631
|
/** Whether to auto-flip tone when contrast can't be met. */
|
|
560
632
|
autoFlip?: boolean;
|
|
633
|
+
/**
|
|
634
|
+
* Manual contrast level (0–100) for this instance, or `'auto'` to opt out
|
|
635
|
+
* of a global level and keep the two-tier normal + high-contrast model.
|
|
636
|
+
*
|
|
637
|
+
* Only an instance-authored level is frozen into `.export()` snapshots — a
|
|
638
|
+
* level inherited from the global config is treated as a live preference and
|
|
639
|
+
* re-read at restore time.
|
|
640
|
+
*
|
|
641
|
+
* @see GlazeConfig.contrastLevel
|
|
642
|
+
*/
|
|
643
|
+
contrastLevel?: number | 'auto';
|
|
561
644
|
/**
|
|
562
645
|
* Instance-level pastel default for colors that omit per-color `pastel`.
|
|
563
646
|
* Not available on `glaze.configure()` — set here or per-color.
|
|
@@ -1723,5 +1806,5 @@ declare function srgbToHex(rgb: [number, number, number]): `#${string}`;
|
|
|
1723
1806
|
*/
|
|
1724
1807
|
declare function okhslToOklch(h: number, s: number, l: number, pastel?: boolean): [number, number, number];
|
|
1725
1808
|
//#endregion
|
|
1726
|
-
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, resolveContrastForMode, resolveMinContrast, roleToPolarity, srgbToHex, srgbToOkhsl, toTone, toneFromY, variantToOkhsl, yFromTone };
|
|
1809
|
+
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 };
|
|
1727
1810
|
//# sourceMappingURL=index.d.mts.map
|