A color conversion tool.
go get github.com/kayex/color/cmd/color
... or download a pre-compiled binary from the releases page.
Enter any color value as the sole argument to color
, or enter interactive mode by running the program without any arguments.
Most color strings need to be quoted when passed directly on the command line.
$ color "#ffee00"
Choose an output format by pressing 1 - 4 followed by Enter and the converted color value will be copied to the system clipboard.
[x] RGB (8-bit channels)
[x] RGB (float channels)
[/] RGBA
[x] Hex triplet
[x] Hex triplet (short)
[ ] HSL
[ ] HSLA
Color tries to be as accomodating as possible when parsing input. All of the following color strings are parsed correctly:
255 255 255
rgb 255 255 255
rgb(255,255,255)
rgb(255, 255, 255)
rgb(1.0, 1.0, 1.0)
rgba(255, 255, 255, 0.5)
rgba 0 0 0 0.5
#f0a
#ff00aa