import React from "react" import { Block } from "baseui/block" import Scrollable from "~/components/Scrollable" import { HexColorPicker } from "react-colorful" import { Delete } from "baseui/icon" import { throttle } from "lodash" import { useEditor } from "@layerhub-io/react" const PRESET_COLORS = [ "#f44336", "#ff9800", "#ffee58", "#66bb6a", "#26a69a", "#03a9f4", "#3f51b5", "#673ab7", "#9c27b0", "#ec407a", "#8d6e63", "#d9d9d9", ] export default function () { const editor = useEditor() const updateCanvasBackground = throttle((color: string) => { editor.canvas.setBackgroundColor(color) }, 100) return ( Canvas Fill Preset colors {PRESET_COLORS.map((color, index) => ( updateCanvasBackground(color)} backgroundColor={color} height={"38px"} key={index} > ))} ) }