Terminal (TUI) color picker
  • Go 99.4%
  • Dockerfile 0.6%
Find a file
2026-06-12 14:49:25 -07:00
.github Initial skeleton 2025-08-04 20:01:56 -07:00
.gitignore Initial skeleton 2025-08-04 20:01:56 -07:00
decode.go Add oklch color space (#20) 2025-09-25 10:20:16 -07:00
Dockerfile Initial skeleton 2025-08-04 20:01:56 -07:00
go.mod Bump fortio.org/terminal in the fortio-and-grol group (#38) 2026-06-12 14:49:25 -07:00
go.sum Bump fortio.org/terminal in the fortio-and-grol group (#38) 2026-06-12 14:49:25 -07:00
LICENSE Initial commit 2025-08-04 19:50:03 -07:00
README.md Add oklch color space (#20) 2025-09-25 10:20:16 -07:00
screenshot216.png Show color details under cursor/mouse, use new 256 color support and extended HSL<->RGB (#7) 2025-08-15 14:05:29 -07:00
screenshotHSL.png Show color details under cursor/mouse, use new 256 color support and extended HSL<->RGB (#7) 2025-08-15 14:05:29 -07:00
screenshotOKLCH.png Add oklch color space (#20) 2025-09-25 10:20:16 -07:00
screenshotRGB.png Show color details under cursor/mouse, use new 256 color support and extended HSL<->RGB (#7) 2025-08-15 14:05:29 -07:00
screenshotSavedColors.png Adding a new mode: decoding/previewing of colors passed as arguments (#11) 2025-08-16 16:25:03 -07:00
tcolor.go Adapt to no more endsync in read input (#32) 2026-01-19 14:50:08 -08:00

GoDoc Go Report Card CI Checks

tcolor

Terminal Color exploration using the Ansipixels TUI go library.

tcolor is a simple terminal/TUI color picker/chooser/explorer.

Multiple modes (space bar and arrows to switch) from basic named colors, to 256 indexed:

256 colors

Hue, Saturation, Lightness:

HSL colors

OKLCH mode:

OKLCH colors

3 RGB screens, eg:

RGB colors

Saved (clicked) colors on exit (and similar if you pass in colors as arguments):

Saved colors

Install

You can get the binary from releases

Or just run

CGO_ENABLED=0 go install fortio.org/tcolor@latest  # to install (in ~/go/bin typically) or just
CGO_ENABLED=0 go run fortio.org/tcolor@latest  # to run without install

or even

docker run -ti fortio/tcolor # but that's obviously slower

or

brew install fortio/tap/tcolor

Run

With no arguments/only flags:

Interactive

Currently 5 interactive screens (3 sub-screens in RGB):

  • Basic 16 colors
  • 256 Colors
  • 24 bits Hue Saturation Luminance (HSL)
  • OKLCH mode
  • 24 bits RGB where space bar change which component is set up/down with arrows. Space bar to switch component.

Up and down arrows to increase luminance on the HSL screen, the third color component on the RGB screen.

Move the mouse for color details.

Click to copy the color code to the clipboard. They are also saved to be printed on exit (Q). If using right clicking, the web HSL is copied instead of the #RRGGBB format. If using a modifier while clicking, the web OKLCH is copied instead of rgb format.

Color decoding

If you pass arguments to tcolor they will be decoded as colors and previewed, with various formats like

c101 # 101th color of the 256 palette
red  # Name from the 16th basic color (+ Orange 17th named color), see list in first screen.
RRGGBB # 6 hex RGB
0.1,.4,.5 # float [0-1] hsl color
hsl(300 40 50) # web css HSL format (degrees percentSaturation percentLightness)
HSL#FFF_FF_200 # full resolution hex hsl (000-FFF hue, 00-FF saturation, 000-3FF lightness)
oklch(0.53 0.12 243) # web oklch color space https://oklch.com/#0.53,0.12,243,100
# and more...
tcolor help
flags:
  -rounding int
        Number of digits to round HSL values for WebHSL output/copy paste (negative for default full precision) (default -1)
  -truecolor
        Use true color (24-bit RGB) instead of 8-bit ANSI colors (default is true if COLORTERM is set) (default true)