mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 18:56:04 +10:00
updated graph rendering to be more efficient. added smooth scrolling, added color type, mmb drag for cutting
This commit is contained in:
26
scripts/nodes/library/colorLiteral.js
Normal file
26
scripts/nodes/library/colorLiteral.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { createNodeModule } from "../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Constant color literal.
|
||||
*/
|
||||
export const colorLiteralNode = createNodeModule(
|
||||
{
|
||||
id: "color_literal",
|
||||
title: "Color",
|
||||
category: "Values",
|
||||
description: "Constant color literal (0-15).",
|
||||
searchTags: ["color", "literal", "constant", "value"],
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{ id: "value", name: "Value", direction: "output", kind: "color" },
|
||||
],
|
||||
properties: [
|
||||
{ key: "value", label: "Color", type: "number", defaultValue: 7 },
|
||||
],
|
||||
},
|
||||
{
|
||||
evaluateValue: ({ node, formatLiteral }) => {
|
||||
return formatLiteral("number", node.properties.value ?? 7);
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user