mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
No named colors and lowercase hex (#395)
* No named colors and lowercase hex * consistent
This commit is contained in:
parent
1ae3c64860
commit
8154ccd907
7 changed files with 57 additions and 64 deletions
|
@ -60,14 +60,7 @@ export const SHAPES = [
|
|||
icon: (
|
||||
// custom
|
||||
<svg viewBox="0 0 6 6">
|
||||
<line
|
||||
x1="0"
|
||||
y1="3"
|
||||
x2="6"
|
||||
y2="3"
|
||||
stroke="black"
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
<line x1="0" y1="3" x2="6" y2="3" stroke="#000" strokeLinecap="round" />
|
||||
</svg>
|
||||
),
|
||||
value: "line"
|
||||
|
@ -75,13 +68,15 @@ export const SHAPES = [
|
|||
];
|
||||
|
||||
export const shapesShortcutKeys = SHAPES.map((shape, index) => [
|
||||
shape.value[0], (index + 1).toString()]
|
||||
).flat(1);
|
||||
shape.value[0],
|
||||
(index + 1).toString()
|
||||
]).flat(1);
|
||||
|
||||
export function findShapeByKey(key: string) {
|
||||
const defaultElement = "selection";
|
||||
return SHAPES.reduce((element, shape, index) => {
|
||||
if (shape.value[0] !== key && key !== (index + 1).toString()) return element;
|
||||
if (shape.value[0] !== key && key !== (index + 1).toString())
|
||||
return element;
|
||||
|
||||
return shape.value;
|
||||
}, defaultElement);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue