Skip to content

Commit

Permalink
fix(theme generate): Fix vbenjs#604
Browse files Browse the repository at this point in the history
fix(theme generate): Fix vbenjs#604
  • Loading branch information
jiangmaniu committed May 14, 2021
1 parent d34467d commit 99d9f72
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions build/config/themeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@ export const darkMode = 'light';

type Fn = (...arg: any) => any;

type GenerateTheme = 'default' | 'dark'

export interface GenerateColorsParams {
mixLighten: Fn;
mixDarken: Fn;
tinycolor: any;
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({
Expand Down

0 comments on commit 99d9f72

Please sign in to comment.