mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 09:18:30 +02:00
Integrated update experience (#259)
This commit is contained in:
20
src-web/lib/color.ts
Normal file
20
src-web/lib/color.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { Color } from '@yaakapp-internal/plugins';
|
||||
|
||||
const colors: Record<Color, boolean> = {
|
||||
primary: true,
|
||||
secondary: true,
|
||||
success: true,
|
||||
notice: true,
|
||||
warning: true,
|
||||
danger: true,
|
||||
info: true,
|
||||
};
|
||||
|
||||
export function stringToColor(str: string | null): Color | null {
|
||||
if (!str) return null;
|
||||
const strLower = str.toLowerCase();
|
||||
if (strLower in colors) {
|
||||
return strLower as Color;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user