未验证 提交 c26dd034 编写于 作者: 江麻妞 提交者: GitHub

fix(theme generate): Fix #604 (#605)

fix(theme generate): Fix #604
上级 336be680
...@@ -6,6 +6,8 @@ export const darkMode = 'light'; ...@@ -6,6 +6,8 @@ export const darkMode = 'light';
type Fn = (...arg: any) => any; type Fn = (...arg: any) => any;
type GenerateTheme = 'default' | 'dark'
export interface GenerateColorsParams { export interface GenerateColorsParams {
mixLighten: Fn; mixLighten: Fn;
mixDarken: Fn; mixDarken: Fn;
...@@ -13,19 +15,19 @@ export interface GenerateColorsParams { ...@@ -13,19 +15,19 @@ export interface GenerateColorsParams {
color?: string; color?: string;
} }
export function generateAntColors(color: string) { export function generateAntColors(color: string, theme: GenerateTheme = 'default') {
return generate(color, { return generate(color, {
theme: 'default', theme
}); });
} }
export function getThemeColors(color?: string) { export function getThemeColors(color?: string) {
const tc = color || primaryColor; const tc = color || primaryColor;
const colors = generateAntColors(tc); const lightColors = generateAntColors(tc);
const primary = colors[5]; const primary = colors[5];
const modeColors = generateAntColors(primary); const modeColors = generateAntColors(primary, 'dark');
return [...colors, ...modeColors]; return [...lightColors, ...modeColors];
} }
export function generateColors({ export function generateColors({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册