mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: ColorPicker getColor (#5949)
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
7e135c4e22
commit
6273d56524
1 changed files with 6 additions and 3 deletions
|
@ -66,10 +66,13 @@ const getColor = (color: string): string | null => {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isValidColor(color)
|
// testing for `#` first fixes a bug on Electron (more specfically, an
|
||||||
? color
|
// Obsidian popout window), where a hex color without `#` is (incorrectly)
|
||||||
: isValidColor(`#${color}`)
|
// considered valid
|
||||||
|
return isValidColor(`#${color}`)
|
||||||
? `#${color}`
|
? `#${color}`
|
||||||
|
: isValidColor(color)
|
||||||
|
? color
|
||||||
: null;
|
: null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue