All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Replace
print
command with more powerfulprintf
command
This is a patch release with a few color picker improvements.
-
#46
: This adds a CIELAB color picker. Open it withcolo pick lab
. It also adds rectangle color pickers. By pressing S, you can now toggle between 3 sliders and a rectangle + a slider:Note that when pressing S, the currently selected slider will serve as the x-axis of the rectangle; the next slider becomes the y-axis. Select a slider with the ArrowUp and ArrowDown keys.
This release brings many new features, including a terminal color picker and commands for mixing colors and generating gradients.
-
#43
: Add color picker. Pick a color withcolo pick
. You can select a color with the arrow keys, or by entering the numbers manually. You can switch between different color pickers with Tab. Currently supported color pickers are- HSL (hue, saturation, light)
- HSV (hue, saturation, value)
- RGB (red, green, blue)
- CMY (cyan, magenta, yellow)
-
#45
: Allow-
andpick
everywhere. Wherever you're supposed to enter a color, you can now enter-
to read the color from stdin, orpick
to select the color in the color picker. For example:colo s orange - pick rand # first color: orange # second color: read from stdin # third color: selected in the color picker # fourth color: randomly generated
-
#45
: Addgry
(grayscale) color space. This color space can't represent color hue and saturation, but it's useful to convert a color to grayscale. -
#46
: Addmix
command. This command mixes two (or more) colors in a given color space (defaults tolab
). Each color is assigned a weight to control the ratio in which the colors are mixed:colo mix orange blue purple # ratio 1:1:1 colo mix orange blue -w 1,2,3 # ratio 1:2:3
-
#46
: Addgradient
command. This command generates a gradient between two colors in a given color space (defaults tolab
). Usually the gradient is displayed in the terminal; if the command is piped to another program, a list of colors is printed.
#42
: Regression in 0.3.2 fixed:--output
flag didn't work because of a typo
Announcing the new website, which explains how to use colo with nice terminal graphics! The graphics are rendered as HTML, so you can copy+paste the commands.
-
#39
: Colors can now be randomly generated. Random colors can be used everywhere:> colo s rand > colo contrast rand rand > colo print "Hello world" rand
The
rand
keyword creates a random color in the sRGB space. You can also use a different color space and specify some of the values:> colo s "hsl(rand, 100%, 50%)" > colo s "cmy(100%, rand, rand)"
-
#41
: The--color
flag can override the behavior when the output uses color:never
: Don't use coloralways
: Always print with colorauto
: Use color if the standard output is a tty, i.e. ifcolo
was invoked in the terminal and isn't behind a pipe.
#41
: The output ofcolo term
was updated.#40
: Help pages were improved significantly. Show help withcolo help
or withcolo help <subcommand>
.
- Fixed pipes: A few bugs were fixed where
colo
printed with color or listened to stdin when it shouldn't.
#30
: Align square vertically with text#31
: Support piping, for example$ echo Hello world | colo print orange $ echo blue orange | colo s $ echo blue orange | colo textcolor
#37
:textcolor
andcontrast
commands- The
textcolor
command shows a color (either black or white) that is readable on a given background color. - The
contrast
command shows the contrast ratio between two colors according the W3 specification.
- The
This release completely revamped the command line options, now using subcommands (see #21
):
-
colo show
(or shortcolo s
) shows one or more colors, which are entered consecutively. You'll notice that the output is now more space efficient and informative. I hope you like the new layout!The flag to specify the color space was removed, now it can be entered as
'rgb(0, 50, 150)'
. Note that the parentheses and commas are optional for your convenience. For example, you could type:colo s rgb 0 50 150, cmy .5 .2 0
The
--out
flag accepts two additional formats,hex
andhtml
. If converting the color to an HTML color name fails, it defaults tohex
. Note that this flag is only really useful when piping to another command, e.g.colo s orange red fuchsia -o cmy > somefile.txt
The output format is no longer JSON, but the human-readable format, which is also used by HTML and can be parsed by
colo
. If you needed JSON output, please file an issue so we can add this functionality again.When displaying certain color values, percentage values are now used, for example for saturation and light.
-
colo print
displays some text in a certain color. A second color can be specified for the background. There are also the following flags to alter the text style:-b
for bold text-i
for italic text-u
for underlined text-n
to not print a new line afterwards – this is useful to change the style in the middle of a line:
colo print -n "Hello " orange && colo print "world!" red
-
colo term
replacescolo --term
. It is used to print the default terminal colors. -
colo libs
replacescolo --libs
. It prints the dependency treecolo
was compiled with. -
colo help
prints help information. Usecolo help <subcommand>
to show help for a subcommand. -
The version flag
-v
was renamed to-V
again. -
#22
: HTML colors containing the word "gray" can now also be spelled "grey". -
#23
: Colo now suggests the correct HTML color name if you misspell it. -
#24
,#29
: Most color spaces now have a nice description here. -
#27
: Added thecolo list
subcommand, which shows all HTML colors. -
#29
: Colo now supports percent values, e.g.cmy 0 100% 25%
.
#17
: Converting a color to CMYK used to outputcmyk(0, 0, 0, 0)
for any input#28
: Displaying hexadecimal colors was broken for colors where the R, G or B value was bigger than 255.
- The
crossterm
dependency was replaced with the more lightweightcolored
. - Added
thiserror
for better enum error handling.
#10
: Flag--libraries
to print dependency tree
- Workflow added to publish binaries for Linux, Windows and macOS every time a new version is released
- Improved documentation and tests
1bab356
: Fix false version (the version in the CLI is now automatically kept up to date)
This release revamps the CLI arguments, adds the --size
argument and fixes a few bugs.
#3
: Add--size
/-s
argument to specify the size of the color square
-
#3
: Input color spaces are now entered with the--in
or-i
argument.There are now 5 flags (
-R, -C, -K, -V, -L
) as abbreviations for--in rgb, --in cmy, --in cmyk, --in hsv, --in hsl
. -
#3
: The shortcut for--version
is now-v
(lowercase) instead of-V
This release adds a GitHub workflow to test pull requests on Windows, Linux and macOS. Of course, this is no substitute for real-world testing, so please report any issues you encounter!
This release also adds some documentation, but the code quality is still not too good. If you want to help by writing tests or documenting code, just file a PR ;)
Initial release