Watch
1
0
Fork
You've already forked cola
0
mirror of https://knot1.tangled.sh/did:plc:24q6tcqteup7dryf6dvzfnli synced 2026-11-03 20:49:36 +00:00
A tool for designing UI-ready color palettes. (Mirror) https://tangled.org/poss.dog/cola
  • JavaScript 42.6%
  • Go 39.3%
  • CSS 14.5%
  • HTML 3.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
reilly 4e445878a6 docs: convert LICENSE to Markdown as LICENSE.md
Replace the plain-text LICENSE file with a Markdown-rendered copy of
the full AGPL-3.0 text. The license terms are unchanged.
2026-10-21 01:52:47 -05:00
docs docs: add screenshot to README after AI disclosure 2026-10-01 13:19:26 -05:00
internal feat(palette)!: tint as a hidden tenth row instead of one fixed color 2026-10-01 13:02:35 -05:00
static feat(palette)!: tint as a hidden tenth row instead of one fixed color 2026-10-01 13:02:35 -05:00
.gitignore Initial commit 2026-09-30 20:08:44 -05:00
AGENTS.md feat(ui): reset also switches the view filter to Off 2026-10-01 02:56:59 -05:00
go.mod Initial commit 2026-09-30 20:08:44 -05:00
handler_test.go feat(palette)!: tint as a hidden tenth row instead of one fixed color 2026-10-01 13:02:35 -05:00
LICENSE.md docs: convert LICENSE to Markdown as LICENSE.md 2026-10-21 01:52:47 -05:00
main.go fix: harden concurrency and escaping issues found in review 2026-10-01 01:02:58 -05:00
main_test.go Initial commit 2026-09-30 20:08:44 -05:00
persist.go fix(preview): render the terminal search match on its actual line 2026-10-01 01:07:27 -05:00
README.md docs: trim README to be an overview, not a manual 2026-10-01 13:27:45 -05:00
tls.go Initial commit 2026-09-30 20:08:44 -05:00

Cola

🤖 This code was written by a human-led AI agent.

Screenshot of the Cola palette designer

A web-based designer for UI-ready color palettes, modeled on Flexoki: nine colors (base, red, orange, yellow, green, cyan, blue, purple, magenta), each sampled at thirteen Oklab lightness levels (50, 100, 150, 200, 300, 400, 500, 600, 700, 800, 850, 900, 950). All swatches are computed in Oklab so equal levels have equal perceived luminosity regardless of hue. Out-of-gamut colors are pulled back by reducing chroma at fixed lightness and hue.

Run

go run .            # serves HTTPS on https://127.0.0.1:8443
go run . -addr :9000
go run . -http      # plain HTTP, for scripting

Settings persist to state.json (override with -state), debounced after changes and flushed on shutdown. First run generates a self-signed certificate for localhost in certs/. Trust it via your OS keychain, or use -http.

curl --cacert certs/localhost.crt https://127.0.0.1:8443/api/palette

Controls

Global sliders:

  • Lightest/darkest L — Oklab lightness for levels 50 and 950; intermediate levels are distributed between them with Flexoki-style spacing
  • Bend — power-law skew of that distribution (positive pulls toward light)
  • Pinch — bunch steps around a center point
  • Saturation — global chroma multiplier
  • Tint hue/chroma/intensity — mix a hidden tenth row into every color

Per-color OKLCH hue and chroma sliders (clamped to ±30° from ideal center for chromatic colors; base is unconstrained).

Double-click any slider to reset it. Click swatches to copy hex. Header buttons copy the full palette as CSS custom properties or JSON.

A/B testing compares two variants side-by-side; both slots persist across restarts.

View filters (display-only): Grayscale, protanopia/deuteranopia/tritanopia CVD simulations, blue light filter.

Previews

  • Grid — the swatch matrix
  • Wheel — polar view by hue or fixed layout
  • Gamut — interactive 3D OKLCH plot (angle=hue, radius=chroma, height=lightness)
  • Contrast — WCAG AA report on realistic UI pairings
  • Code — syntax-highlighted examples in graphical, terminal, and agent environments
  • Notes — Obsidian-style note app with pairings display
  • Landing — fictional brand page exercising all ramps
  • Design — graphic design scenarios (posters, album art, patterns, type specimen)

All previews render live from the current palette and honor view filters.

Light/dark toggle

Global scheme that complements all levels (50↔950, 200↔800, 500 fixed). Each preview keeps its native face and is only complemented when the global scheme differs. The app's own UI (dogfooding) is themed from the palette too.

HTTP API

  • GET /api/palette — current state and generated palette, plus defaults
  • POST /api/palette — update state; optional filters array and blueLight intensity; returns palette and filtered copy
  • POST /api/reset — restore default state; body may include filters, blueLight, activeSlot; other fields are ignored

A/B record (ab) is carried in every response and persisted in state.json.

Repository layout and development conventions in AGENTS.md.