mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-06 12:33:12 +08:00
21 lines
454 B
TypeScript
21 lines
454 B
TypeScript
import { ThemeColors } from '../interfaces';
|
|
|
|
// parse theme in PAB (primary;accent;background) format to theme colors object
|
|
export const parsePABToTheme = (themeStr: string): ThemeColors => {
|
|
const [primary, accent, background] = themeStr.split(';');
|
|
|
|
return {
|
|
primary,
|
|
accent,
|
|
background,
|
|
};
|
|
};
|
|
|
|
export const parseThemeToPAB = ({
|
|
primary: p,
|
|
accent: a,
|
|
background: b,
|
|
}: ThemeColors): string => {
|
|
return `${p};${a};${b}`;
|
|
};
|