Files
figcraft/plugins/examples/swatch-grid/figcraft-plugin.json
T
BFlat a003e3de4f M7: plugin panels and settings (#124)
Plugin ABI v2: a plugin can show a panel (text, number, checkbox, select, colour, list, notes, buttons) rendered with FigCraft's widgets, react to events with its state kept between calls (each editing callback one undo step, full sandbox limits on every call), and store per-plugin settings (64 KB). plugin.ui / plugin.event / plugin.close drive panels from the CLI and MCP; v1 plugins run unchanged. The Swatch grid example gains a Palettes panel that remembers the last palette.
2026-10-11 14:45:19 +07:00

27 lines
1.0 KiB
JSON

{
"id": "org.figcraft.examples.swatch-grid",
"name": "Swatch grid",
"version": "1.1.0",
"description": "Makes a grid of colour swatches from a built-in palette (in a panel) or from hex colours.",
"main": "swatch_grid.wasm",
"api": 2,
"permissions": {
"access": "write",
"commands": ["view.get", "shape.rectangle", "text.create", "select.set"]
},
"commands": [
{ "id": "panel", "label": "Palettes…" },
{
"id": "grid",
"label": "From hex colours…",
"params": [
{ "name": "palette", "label": "Palette", "type": "text", "default": "#FF5A5F, #FFB400, #00A699, #007A87, #7B0051, #3D3D3D" },
{ "name": "columns", "label": "Columns", "type": "number", "default": 3, "min": 1, "max": 24 },
{ "name": "size", "label": "Swatch size", "type": "number", "default": 64, "min": 8, "max": 512 },
{ "name": "gap", "label": "Gap", "type": "number", "default": 16, "min": 0, "max": 256 },
{ "name": "labels", "label": "Label each swatch", "type": "boolean", "default": true }
]
}
]
}