mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-17 05:13:32 +00:00
refactor: timer design review
This commit is contained in:
@@ -55,6 +55,18 @@ export function isStringBoolean(text: string | null) {
|
||||
return text?.toLowerCase() === 'true' || text === '1';
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares a colour string for use in views
|
||||
* Colours in params do not have the #prefix
|
||||
*/
|
||||
export function makeColourString(hex: string | null): string | undefined {
|
||||
if (!hex) {
|
||||
return undefined;
|
||||
}
|
||||
// ensure the hex starts with a #
|
||||
return hex.startsWith('#') ? hex : `#${hex}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a dynamic property from an event
|
||||
* Considers custom fields
|
||||
|
||||
Reference in New Issue
Block a user