wip: making themes more dynamic and easy to add
This commit is contained in:
@@ -7,29 +7,24 @@ export type ThemePattern = 'waves' | 'geometric' | 'dots' | 'none';
|
||||
export interface Theme {
|
||||
name: string;
|
||||
pattern: ThemePattern;
|
||||
opacity: number;
|
||||
}
|
||||
|
||||
export const AVAILABLE_THEMES: Record<string, Theme> = {
|
||||
none: {
|
||||
name: 'None',
|
||||
pattern: 'none',
|
||||
opacity: 0
|
||||
},
|
||||
waves: {
|
||||
name: 'Waves',
|
||||
pattern: 'waves',
|
||||
opacity: 0.1
|
||||
},
|
||||
geometric: {
|
||||
name: 'Geometric',
|
||||
pattern: 'geometric',
|
||||
opacity: 0.1
|
||||
},
|
||||
dots: {
|
||||
name: 'Dots',
|
||||
pattern: 'dots',
|
||||
opacity: 0.15
|
||||
}
|
||||
};
|
||||
|
||||
@@ -41,16 +36,3 @@ export function getTheme(themeName?: string | null): Theme {
|
||||
}
|
||||
return AVAILABLE_THEMES[themeName];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color from a CSS color string or class
|
||||
* Returns the provided color or a default primary color
|
||||
*/
|
||||
export function getThemeColor(color?: string | null): string {
|
||||
// Use the provided color, or default to a visible color
|
||||
if (color && color !== 'null' && color !== '') {
|
||||
return color;
|
||||
}
|
||||
// Default to a blue color (can't use CSS variables in SVG fill)
|
||||
return '#3b82f6';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user