Skip to content
Snippets Groups Projects
Commit 6015e04f authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

Added small color preview

parent 71e3e0a4
No related branches found
No related tags found
No related merge requests found
Pipeline #57090 failed
......@@ -10,3 +10,10 @@ div#ks-editor input {
div#ks-editor .node-type-color {
margin-bottom: 1em;
}
div#ks-editor .color-circle {
width: 15px;
height: 15px;
margin: 10px;
border-radius: 50%;
}
import React, { useState } from "react";
import { ColorData, NodeType, NodeTypeData } from "../../common/graph/nodetype";
import { colorToRGB } from "../../common/helpers";
import "./nodetypeentry.css";
type NodeTypeEntryProps = {
......@@ -97,6 +98,12 @@ function NodeTypeEntry({
value={nodeType.color.b.toString()}
onChange={(event) => handleColorChange("b", event.target.value)}
/>
<div
className={"color-circle"}
style={{
backgroundColor: colorToRGB(nodeType.color),
}}
></div>
<br />
<button onClick={() => onNodeTypeSelect(nodeType)}>
Select nodes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment