diff --git a/src/actions/actionCanvas.tsx b/src/actions/actionCanvas.tsx index ef9376c0..a95d5075 100644 --- a/src/actions/actionCanvas.tsx +++ b/src/actions/actionCanvas.tsx @@ -11,6 +11,7 @@ export const actionChangeViewBackgroundColor: Action = { <>
Canvas Background Color
updateData(color)} /> diff --git a/src/actions/actionProperties.tsx b/src/actions/actionProperties.tsx index a637b786..785788e1 100644 --- a/src/actions/actionProperties.tsx +++ b/src/actions/actionProperties.tsx @@ -32,6 +32,7 @@ export const actionChangeStrokeColor: Action = { PanelComponent: ({ elements, appState, updateData }) => ( { updateData(color); }} @@ -57,6 +58,7 @@ export const actionChangeBackgroundColor: Action = { PanelComponent: ({ elements, updateData }) => ( { updateData(color); }} diff --git a/src/components/ColorPicker.tsx b/src/components/ColorPicker.tsx index 647e3f76..3090ed39 100644 --- a/src/components/ColorPicker.tsx +++ b/src/components/ColorPicker.tsx @@ -8,9 +8,11 @@ const TwitterPicker = lazy(() => ); export function ColorPicker({ + type, color, onChange }: { + type: "canvasBackground" | "elementBackground" | "elementStroke"; color: string | null; onChange: (color: string) => void; }) { @@ -26,19 +28,7 @@ export function ColorPicker({ {isActive ? ( setActive(false)}> { @@ -58,3 +48,45 @@ export function ColorPicker({ ); } + +const colors = { + canvasBackground: [ + "#DEE6EF", + "#FCEAD8", + "#F9E0E0", + "#E6F1F1", + "#E0EDDF", + "#FBF5DD", + "#F0E6ED", + "#FFEDEF", + "#EDE5E1", + "#F2F0EF", + "#FFFFFF" + ], + elementBackground: [ + "#4E79A7", + "#F28E2C", + "#E15759", + "#76B7B2", + "#59A14F", + "#EDC949", + "#AF7AA1", + "#FF9DA7", + "#9C755F", + "#BAB0AB", + "#FFFFFF" + ], + elementStroke: [ + "#324E6B", + "#9B5B1D", + "#903839", + "#4C7572", + "#396733", + "#AD9336", + "#805976", + "#BA737A", + "#725646", + "#88817D", + "#000000" + ] +}; diff --git a/src/components/panels/PanelColor.tsx b/src/components/panels/PanelColor.tsx index c61bf2a1..bd4cd762 100644 --- a/src/components/panels/PanelColor.tsx +++ b/src/components/panels/PanelColor.tsx @@ -3,12 +3,14 @@ import { ColorPicker } from "../ColorPicker"; interface PanelColorProps { title: string; + colorType: "canvasBackground" | "elementBackground" | "elementStroke"; colorValue: string | null; onColorChange: (value: string) => void; } export const PanelColor: React.FC = ({ title, + colorType, onColorChange, colorValue }) => { @@ -16,6 +18,7 @@ export const PanelColor: React.FC = ({ <>
{title}
onColorChange(color)} />