No description
Find a file
2019-09-25 10:46:22 +02:00
src Reimplement command-line argument parsing using cligen 2019-07-08 00:27:33 +02:00
.editorconfig Add an EditorConfig file 2018-11-12 11:31:39 +01:00
.gitignore Use -d:mingw to cross-compile from Linux to Windows 2019-06-24 21:39:21 +02:00
.gitlab-ci.yml Use -d:mingw to cross-compile from Linux to Windows 2019-06-24 21:39:21 +02:00
.pre-commit-config.yaml Add pre-commit hooks 2018-10-16 14:44:04 +02:00
.travis.yml Travis CI: Use Xcode 10.1 image 2018-11-08 20:12:59 +01:00
CHANGELOG.md Bump to version 1.0.0 2019-07-08 00:27:34 +02:00
clr.nimble Bump to version 1.0.0 2019-07-08 00:27:34 +02:00
LICENSE.md Update copyright statements to 2019 2019-07-05 00:23:43 +02:00
README.md Refer to Pastel in the README 2019-09-25 10:46:22 +02:00

clr

Get information about colors and convert them in the command line.


A more powerful tool for doing this has been released. You may want to look at Pastel instead.


Use cases

  • As HSL colors are easier to reason about by humans, you want to use an HSL color in software that only accepts RGB colors or hexadecimal color codes.
  • You want to perform color manipulation to derive a color scheme from a base color.

Installation

Binary releases

Download a binary for your operating system on the Releases page. Make sure to place it in a location present in your PATH environment variable.

Building from source

After installing Nim and Nimble (bundled with Nim), enter the following command in a terminal:

nimble install clr

Using this installation method, clr will be immediately available in your PATH.

Usage

See the command-line help:

clr
Get information about colors and convert them in the command line.

Usage:
  clr info <color>
  clr invert <color>
  clr lighten <color> <amount>
  clr darken <color> <amount>
  clr saturate <color> <amount>
  clr desaturate <color> <amount>
  clr spin <color> <degrees>
  clr (-h | --help)
  clr (-V | --version)

Options:
  -h --help        Show this screen.
  -V --version     Show version.

Notes:
  <color> accepts the following color formats:
    - #RGB
    - #RRGGBB
    - rgb(R, G, B)
    - hsl(H, S%, L%)
    - hsv(H, S%, L%)
    - HTML color names

  <amount> must be a value between 0 and 1.
  The value will affect the color in an absolute manner.

Colored output

For colors to look correct, you need to set the environment variable COLORTERM to truecolor. You can make this permanent by adding the following line to your shell startup file (such as ~/.bashrc or ~/.zshrc):

export COLORTERM="truecolor"

License

Copyright © 2018-2019 Hugo Locurcio and contributors

Unless otherwise specified, files in this repository are licensed under the MIT license; see LICENSE.md for more information.