mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-02-02 19:08:40 +08:00
parent
336be680d3
commit
c26dd03416
@ -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 {
|
|||||||
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({
|
||||||
|
Loading…
Reference in New Issue
Block a user