mirror of
				https://github.com/excalidraw/excalidraw.git
				synced 2025-10-31 02:44:50 +01:00 
			
		
		
		
	fix: ColorPicker getColor (#5949)
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
		| @@ -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; | ||||
| }; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 zsviczian
					zsviczian