Skip to content
Edith

Docs

Command reference

ed color copy

Copies one numbered swatch from the colour history to the macOS pasteboard. Numbers match ed color ls, with 1 as the newest colour.

Usage:

Output
ed color copy <index> [--format <f>] [--json]
Name Type / values Default What it does
<index> integer, 1 through the history count required Selects the swatch shown at that position by ed color ls.
--format <f> hex, rgb, hsl, swiftUI, nsColor colorPickerCopyFormat, falling back to hex Chooses the exact text written to the pasteboard.
--json flag off Emits one JSON document on stdout.

JSON reports the shared operation, numbered index, persistent swatch id, chosen format, exact copied value, and copied: true.

JSON
{  "copied": true,  "format": "hex",  "id": "00000000-0000-0000-0000-000000000123",  "index": 1,  "operation": "color.copy",  "value": "#4C6EF5"}

Examples:

Output
ed color copy 1ed color copy 3 --format swiftUIed color copy 1 --format rgb --json

The command uses the same formatters and pasteboard operation as clicking a Recent Colors swatch in Color Picker settings or selecting one from the menu bar context menu. It does not need Edith running. An empty history exits 4 with a prompt to pick a colour. An index outside the current history or an unknown format exits 3 without changing the pasteboard.

Where to go next