Skip to content
This repository has been archived by the owner. It is now read-only.
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

Get information about colors and convert them in the command line. Deprecated, see Pastel:

Topics

Resources

License

Packages

No packages published

Languages