convert-color-cli
Convert hex, rgb, and hsl from one to another from the command line
Last updated 14 days ago by mikemcbride .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install convert-color-cli 
SYNC missed versions from official npm registry.

convert-color-cli

Convert HEX, RGB, and HSL colors to other formats from the command line.

Install

You can install the package globally to use it anywhere:

npm install -g convert-color-cli # or yarn global add convert-color-cli

Usage

Globally

Convert RGB, HEX, or HSL, including alpha values for all three. You can pass any color code in as the optional first parameter:

$ convert-color 'rgb(40, 42, 54)'
$ convert-color 'rgba(40, 42, 54, 75%)'
$ convert-color ff9afd
$ convert-color '#282a36'
$ convert-color 282a36bf
$ convert-color 'hsl(336, 100%, 50%)'
$ convert-color 'hsla(336, 100%, 50%, 0.75)'

The CLI app will detect the format of the color you input and ask which type you'd like to convert it to:

$ convert-color 'hsl(336, 100%, 50%)'

Convert hsl(336, 100%, 50%) to which format:

❯ HEX
  RGB

Upon selecting a format, the converted value will be displayed and the result is copied to your clipboard:

$ convert-color 'hsl(336, 100%, 50%)'

hsl(336, 100%, 50%) converted to RGB is rgb(255, 0, 102).

It has been copied to your clipboard.

Related

  • convert-color-js - the Node module the powers this CLI. You can also use it in the browser.

License

MIT © Mike McBride

Current Tags

  • 2.1.1                                ...           latest (14 days ago)

6 Versions

  • 2.1.1                                ...           14 days ago
  • 2.1.0                                ...           8 months ago
  • 2.0.0                                ...           9 months ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 13
Last Day 0
Last Week 2
Last Month 0
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |