wip colors

This commit is contained in:
Stian Fredrik Aune
2021-06-13 12:47:08 +02:00
parent 22c80a90a1
commit b2375e5864
5 changed files with 38 additions and 14 deletions
+23
View File
@@ -0,0 +1,23 @@
import React, {useCallback, useContext, useState} from "react";
import {ColorPreset} from "../models/Colors";
import DialogContext from "../contexts/DialogContext";
import {DialogType} from "../models/Dialog";
interface ColorDialogProps {
data?: ColorPreset
}
export default function ColorDialog({data}: ColorDialogProps) {
const {setDialog} = useContext(DialogContext);
const [name, setName] = useState(data?.name || "");
const [hue, setHue] = useState(data?.value?.h || 0);
const [sat, setSat] = useState(data?.value?.s || 0);
const [kelvin, setKelvin] = useState(data?.value?.kelvin || 0);
const onClose = useCallback(() => {
setDialog({type: DialogType.None});
}, [setDialog]);
}