|
|
|
@ -66,10 +66,13 @@ const getColor = (color: string): string | null => {
|
|
|
|
|
return color;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return isValidColor(color)
|
|
|
|
|
? color
|
|
|
|
|
: isValidColor(`#${color}`)
|
|
|
|
|
// testing for `#` first fixes a bug on Electron (more specfically, an
|
|
|
|
|
// Obsidian popout window), where a hex color without `#` is (incorrectly)
|
|
|
|
|
// considered valid
|
|
|
|
|
return isValidColor(`#${color}`)
|
|
|
|
|
? `#${color}`
|
|
|
|
|
: isValidColor(color)
|
|
|
|
|
? color
|
|
|
|
|
: null;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|