excalidraw/src/components/panels/PanelColor.tsx
Enzo Ferey c6accd9fc7 Improve color suggestions (#304)
* Add palettes for each type of color picker.

* Add white canvas background and black element stroke.

* Add white for element background.
2020-01-11 14:58:44 -08:00

28 lines
568 B
TypeScript

import React from "react";
import { ColorPicker } from "../ColorPicker";
interface PanelColorProps {
title: string;
colorType: "canvasBackground" | "elementBackground" | "elementStroke";
colorValue: string | null;
onColorChange: (value: string) => void;
}
export const PanelColor: React.FC<PanelColorProps> = ({
title,
colorType,
onColorChange,
colorValue
}) => {
return (
<>
<h5>{title}</h5>
<ColorPicker
type={colorType}
color={colorValue}
onChange={color => onColorChange(color)}
/>
</>
);
};