export type Tone = number; /** Historical API name retained for compatibility; uses official Material HCT. */ export declare function lch(tone: Tone, chroma: number, hue: number): string; export declare function lchOf(hex: string): { tone: any; chroma: any; hue: any; }; export declare function harmonize(hex: string, tone: Tone, chroma?: number, fallbackHue?: number): string; export declare function contrast(a: string, b: string): number; export declare function onColor(background: string): "#000000" | "#ffffff"; export declare const SPACING: { readonly xs: 4; readonly sm: 8; readonly md: 12; readonly lg: 16; readonly xl: 24; readonly xxl: 32; }; /** 一套色调板:固定色相与彩度,按色调取色。 */ export type Palette = (tone: Tone) => string; export declare function palette(hue: number, chroma: number): Palette; export interface Palettes { primary: Palette; secondary: Palette; tertiary: Palette; neutral: Palette; neutralVariant: Palette; error: Palette; } export interface SourceOptions { /** 主色彩度,默认 56,够鲜艳又不至于在浅色调上大面积溢出色域。 */ chroma?: number; /** * 第三色相对主色的相位差,默认 +60°。 * 这个值规范里是个经验值,并非永远合适:暖橙 +60° 会落到发闷的橄榄绿, * 这种时候改成 -60° 取玫红,强调色才跳得出来。 */ tertiaryShift?: number; } /** * 按 M3 的推导规则从源色相生成六套色调板。 * * Expressive 相比基础风格更敢用彩度:第三色比规范里的保守取值更高, * 中性色也留了一点源色的味道,成片的表面不会灰得发死。 */ export declare function palettesOf(hue: number, options?: SourceOptions): Palettes; export interface Scheme { primary: string; onPrimary: string; primaryContainer: string; onPrimaryContainer: string; secondary: string; onSecondary: string; secondaryContainer: string; onSecondaryContainer: string; tertiary: string; onTertiary: string; tertiaryContainer: string; onTertiaryContainer: string; error: string; onError: string; errorContainer: string; onErrorContainer: string; background: string; onBackground: string; surface: string; onSurface: string; surfaceVariant: string; onSurfaceVariant: string; surfaceDim: string; surfaceBright: string; surfaceContainerLowest: string; surfaceContainerLow: string; surfaceContainer: string; surfaceContainerHigh: string; surfaceContainerHighest: string; outline: string; outlineVariant: string; inverseSurface: string; inverseOnSurface: string; inversePrimary: string; scrim: string; shadow: string; } /** 生成一套完整的角色配色。`dark` 为真时返回暗色方案。 */ export declare function scheme(hue: number, dark?: boolean, options?: SourceOptions): Scheme; /** * M3 Expressive 形状刻度(px)。 * Expressive 把圆角整体推大了一档,容器之间靠「圆角差」而不是分隔线来分层。 */ export declare const SHAPE: { readonly none: 0; readonly extraSmall: 4; readonly small: 8; readonly medium: 12; readonly large: 16; readonly largeIncreased: 20; readonly extraLarge: 28; readonly extraLargeIncreased: 32; readonly extraExtraLarge: 48; readonly full: 9999; }; /** 正文与标题字体栈,覆盖 Windows / macOS / Linux 与随包字体三种情况。 */ export declare const FONT_STACK = "\"Roboto Flex\", \"Roboto\", \"Noto Sans SC\", \"Noto Sans CJK SC\", \"PingFang SC\", \"Microsoft YaHei\", \"Source Han Sans SC\", system-ui, sans-serif"; /** 等宽字体栈,用于比分、倒计时这类需要对齐的数字。 */ export declare const MONO_STACK = "\"Roboto Mono\", \"JetBrains Mono\", \"SF Mono\", \"Cascadia Mono\", Consolas, \"Noto Sans Mono\", monospace"; export interface TypeStyle { size: number; line: number; weight: number; tracking: number; } /** * M3 Expressive 字阶。`emphasized` 档提高字重,用在需要被一眼看到的地方, * 这是 Expressive 与基础风格最直观的差别之一。 */ export declare const TYPE: { displayLarge: { size: number; line: number; weight: number; tracking: number; }; displayMedium: { size: number; line: number; weight: number; tracking: number; }; displaySmall: { size: number; line: number; weight: number; tracking: number; }; headlineLarge: { size: number; line: number; weight: number; tracking: number; }; headlineMedium: { size: number; line: number; weight: number; tracking: number; }; headlineSmall: { size: number; line: number; weight: number; tracking: number; }; titleLarge: { size: number; line: number; weight: number; tracking: number; }; titleMedium: { size: number; line: number; weight: number; tracking: number; }; titleSmall: { size: number; line: number; weight: number; tracking: number; }; bodyLarge: { size: number; line: number; weight: number; tracking: number; }; bodyMedium: { size: number; line: number; weight: number; tracking: number; }; bodySmall: { size: number; line: number; weight: number; tracking: number; }; labelLarge: { size: number; line: number; weight: number; tracking: number; }; labelMedium: { size: number; line: number; weight: number; tracking: number; }; labelSmall: { size: number; line: number; weight: number; tracking: number; }; }; /** * Expressive 的强调字重。取 600 而非规范里的 500:很多机器上只装了 400 / 700 两档, * 500 会回落成常规字重,强调就白做了;600 在这种字体集下会匹配到 700,效果才稳定。 * 正文维持 400,字重拉高反而伤可读性。 */ export declare const EMPHASIZED_WEIGHT: { readonly display: 600; readonly headline: 600; readonly title: 600; readonly label: 600; }; /** 阴影高度(dp -> box-shadow),M3 只有 0 ~ 5 六档。 */ export declare const ELEVATION: readonly ["none", "0 1px 2px 0 rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15)", "0 1px 2px 0 rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15)", "0 1px 3px 0 rgba(0,0,0,.30), 0 4px 8px 3px rgba(0,0,0,.15)", "0 2px 3px 0 rgba(0,0,0,.30), 0 6px 10px 4px rgba(0,0,0,.15)", "0 4px 4px 0 rgba(0,0,0,.30), 0 8px 12px 6px rgba(0,0,0,.15)"]; /** 把配色方案铺成 `--md-sys-color-*` 变量。 */ export declare function colorVars(s: Scheme): string; /** 形状、字阶、高度的变量,与配色一起构成完整的令牌集。 */ export declare function systemVars(): string; /** 一段可直接塞进 `