江麻妞
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
5 deletions
-
build/config/themeConfig.ts
|
|
|
@ -6,6 +6,8 @@ export const darkMode = 'light'; |
|
|
|
|
|
|
|
type Fn = (...arg: any) => any; |
|
|
|
|
|
|
|
type GenerateTheme = 'default' | 'dark' |
|
|
|
|
|
|
|
export interface GenerateColorsParams { |
|
|
|
mixLighten: Fn; |
|
|
|
mixDarken: Fn; |
|
|
|
@ -13,19 +15,19 @@ export interface GenerateColorsParams { |
|
|
|
color?: string; |
|
|
|
} |
|
|
|
|
|
|
|
export function generateAntColors(color: string) { |
|
|
|
export function generateAntColors(color: string, theme: GenerateTheme = 'default') { |
|
|
|
return generate(color, { |
|
|
|
theme: 'default', |
|
|
|
theme |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
export function getThemeColors(color?: string) { |
|
|
|
const tc = color || primaryColor; |
|
|
|
const colors = generateAntColors(tc); |
|
|
|
const lightColors = generateAntColors(tc); |
|
|
|
const primary = colors[5]; |
|
|
|
const modeColors = generateAntColors(primary); |
|
|
|
const modeColors = generateAntColors(primary, 'dark'); |
|
|
|
|
|
|
|
return [...colors, ...modeColors]; |
|
|
|
return [...lightColors, ...modeColors]; |
|
|
|
} |
|
|
|
|
|
|
|
export function generateColors({ |
|
|
|
|