Sketchy is a framework for making generative art in Go. It is inspired by vsketch and openFrameworks. It uses canvas for drawing and the ebiten game engine for the GUI.
Sketches are code-first: you construct a sketchy.Config, call sketchy.New, assign BuildUI to register controls with UI helpers (FloatSlider, IntSlider, Checkbox, ColorPicker, Dropdown, Folder, etc.), then implement Updater and Drawer. Control values are read with GetFloat / GetInt / Toggle using folder and name (use "" for the root folder). There is no sketch.json for controls or layout.
The Getting Started guide walks through install, sketchy init, and a small “Hello Circle” sketch using the code-first API; the examples/ directory has full programs you can copy from.
Below are a couple of screenshots from the example sketches:
Sketchy tracks a recent Go toolchain (see go.mod for the exact minimum). Install the sketchy CLI with:
go install github.com/aldernero/sketchy/cmd/sketchy@latestEnsure $(go env GOPATH)/bin (or your GOBIN directory) is on your PATH so the sketchy command is found.
From any directory, run a tagged example package with go run (no separate clone required):
go run github.com/aldernero/sketchy/examples/lissajous@latestSwap lissajous for another folder name under examples/.
The CLI syntax is sketchy init project_name. That creates a new directory, copies the embedded template (main.go, .gitignore), runs go mod init and go mod tidy:
❯ sketchy init mysketch
❯ tree mysketch
mysketch
├── go.mod
├── go.sum
├── main.go
└── .gitignoreEdit main.go: set fields on sketchy.Config (title, size, colors, DefaultBackground / DefaultForeground / DefaultStrokeWidth, …), register controls in BuildUI, then call Init. The template loads icon.png if present for the window icon.
sketchy run project_name changes into that directory and runs go run . (expects a main.go).
The control panel is built with debugui, an Ebitengine-oriented UI toolkit; see that repository for API details and licensing.
- Folders —
ui.Folder("Title", func() { … })groups controls under a collapsible header. - Float sliders — Track plus a text field for the value (similar to lil-gui). Values are validated as floats; scientific notation such as
1e-12is accepted. UseFloatSliderDecimalswhen you want a fixed number of digits after the decimal in the text box; plainFloatSliderderives display precision from the step. Secondary-click (e.g. right-click) on the slider or value opens a range/step editor modal. - Int sliders — Same pattern with integer-only text validation and stepping.
- Checkboxes, buttons, color pickers, dropdowns — See
ui_builder.go.
The Builtins header is fixed by Sketchy (not part of your uiPlan):
- Seed — Integer seed and Rand button; mirrors
RandomSeed. - Default background / Default foreground — Color pickers; define the canvas clear color and the initial stroke color before your
Drawerruns. The margin around the letterboxed sketch uses a dark grey (Dark theme) or light grey (Light theme) so the drawable area reads clearly against the window border. - Default stroke width — Millimeters, text field with clamped range.
- Save Image… / Take Snapshot… / Load Snapshot… — Dialogs for PNG/SVG export and SQLite-backed snapshots (see below).
The panel is hidden from rasterized sketch output. Close or reopen it with Ctrl+Space (plain Space is reserved for typing in text fields).
- Save Image… — Writes under
saves/png/and/orsaves/svg/relative to the process working directory (usually your sketch project). Saves can be recorded insketch.db. - Snapshots — Stored in
sketch.dbwith:control_json— Sliders, int sliders, toggles, user color pickers, dropdowns.builtin_json— Default background/foreground (hex), default stroke width (mm), and random seed so builtins round-trip with the rest of the controls.
First run creates or migrates the database.
There are no default single-key bindings for “save PNG/SVG/config JSON” in the current codebase; use the Builtins dialogs (and Esc for Ebitengine’s screenshot key if you set EBITEN_SCREENSHOT_KEY in Init).
| Key | Action |
|---|---|
| ↑ / ↓ | Increment / decrement random seed |
| / | Randomize seed |
| Ctrl+Space | Show / hide control panel |
The sketch view can be resized; content is letterboxed/panned when the window aspect differs from the sketch. WindowSize reflects the outer window size used by Ebitengine.




