Skip to content
Edith

Docs

Command reference

ed color

ed color opens Edith's system loupe and reads the swatch history it keeps: every colour you have sampled, newest first, in whichever of the five representations you ask for. Reach for it when you want to start a pick from the terminal, copy a stored swatch, or move the latest result into a script or stylesheet.

The history is stored in Edith's settings, so its list, copy, and clear operations work whether or not the app is running. colour is an accepted spelling of the group, and ed color with nothing after it is ed color ls.

ed color pick asks the running app to open the same colour sampler as the eyedropper and hotkey (⌃⌥⌘C unless you have rebound it). The command returns once the request is sent, while the pick finishes on the desktop.

At a glance

Command What it does
ed color Runs ed color ls, which is the default subcommand.
ed color pick Requests the system colour sampler from the running menu bar app.
ed color ls Lists picked colours, newest first, as a table or as one chosen format per line.
ed color copy Copies one numbered swatch using its configured or requested format.
ed color clear Previews forgetting every picked colour; --yes applies it.

ed colour is the same group under its British spelling, and ed color list is the same command as ed color ls.

Commands

Exit codes

Code When this group produces it
0 The sampler request was sent, the listing printed, a swatch was copied, or the history was cleared. Also an empty listing, and help.
2 --limit was negative (--limit cannot be negative), or the command line was wrong in ArgumentParser's own terms: an unknown flag, --format or --limit with no value, or a --limit value that is not an integer.
3 --format named something that is not hex, rgb, hsl, swiftUI or nsColor, or copy named an index outside the history.
4 ed color pick found the extension off, copy found an empty history, or the pasteboard refused the value.

Nothing in this group exits 1. Listing, copying, and clearing need no app, while picking is an app request and uses exit 4 when it cannot be delivered.

Notes and gotchas

  • The history is stored in Edith's settings under colorPickerHistory, as a JSON-encoded array of swatches. It is not a setting, so ed config ls colorPicker lists the picker's seven preferences and never the history itself, ed config unset has nothing to unset here, and neither ed config export nor Edith's own settings backup carries the swatches to another Mac.
  • Order is newest first because the app inserts each new swatch at the front and truncates to colorPickerHistorySize. ed re-reads the store on every invocation and does no sorting of its own, so the first row is always the most recent pick.
  • Lowering colorPickerHistorySize does not trim what is already stored. The cap is applied when the next colour is picked, so until then ed color ls --limit 0 can return more swatches than the setting allows.
  • Unreadable or absent stored data decodes to an empty history rather than to an error, so a corrupted key looks exactly like a picker you have never used.
  • Every swatch is opaque. The formatters clamp each component to 0 through 1, and nsColor always ends alpha: 1.0, because the loupe never records transparency.
  • The formatters do not convert between colour spaces. A displayP3 swatch and an sRGB swatch with the same components print identical hex, rgb and hsl strings; the profile field is what tells you which space those numbers are in. Set the space you sample in with ed config set colorPickerProfile sRGB|displayP3.
  • Exact shapes, so you can match on them: hex is #RRGGBB with uppercase digits, rgb is rgb(76, 110, 245) with components rounded to 0 through 255, hsl is hsl(228, 89%, 63%) with integer degrees and percentages, swiftUI is Color(red: 0.2980, green: 0.4310, blue: 0.9610) and nsColor is NSColor(red: 0.2980, green: 0.4310, blue: 0.9610, alpha: 1.0), both with four decimal places.
  • --format is validated even when --json is passed, but it changes nothing about the output: with --json you always get hex, rgb and hsl. So ed color ls --json --format nonsense exits 3 while ed color ls --json --format hsl is the same document as ed color ls --json.
  • What the picker copies to the pasteboard when you sample is a separate choice, ed config set colorPickerCopyFormat hex|rgb|hsl|swiftUI|nsColor. ed color copy uses that choice unless --format overrides it. Changing it does not change what ed color ls prints.
  • The picker only runs when its extension is on (ed extensions enable colorPicker, which is the colorPickerEnabled setting and wants the Screen Recording permission), but the history outlives the switch: turning the extension off stops new colours being recorded and leaves the ones already there readable.
  • ed color ls --format hex --limit 8 prints the last eight picks in hex.
  • --help works on the group and on all four verbs, prints on stdout and exits 0.
  • ed color pick is safe to request without a TTY because it never reads stdin, but the sampler still requires a person at the logged-in desktop.
  • Completion knows this group: ed color ls --format <TAB> offers hex, rgb, hsl, swiftUI and nsColor. A bare ed color ls <TAB> offers them as well, because the completion tree hangs the format list off the command rather than off the flag; ls still takes no positional argument, and passing one is an ArgumentParser error and exits 2.

Where to go next