Skip to content

Simple color conversions from RGB to Hex and vice-versa.

Notifications You must be signed in to change notification settings

gness1804/color-converters

Repository files navigation

@gness1804/color-converters

A utility that provides simple color conversions from RGB to Hex and vice-versa. Can be used to quickly convert one to the other on the command line.


Install

npm install -g @gness1804/color-converters
OR
yarn global add @gness1804/color-converters

Usage

The color-converters package will give you access to two binaries: rgb-to-hex and hex-to-rgb. The names are pretty self-explanatory. The package is meant as a global module, used as follows:

rgb-to-hex <command> [option]
hex-to-rgb <command> [option]

For conversions, you might do something like this:

rgb-to-hex -r <red value> -g <green value> -b <blue value>

rgb-to-hex -r 255 -g 0 -b 0
# outputs "Success!  Your hex value is #ff0000"
hex-to-rgb -h <hex value>
hex-to-rgb -h "#fff"
hex-to-rgb -h "#ffffff"
# both output "Success!  Your RGB value is 255 255 255"

All Commands and Options

For rgb-to-hex:

COMMANDS

  help  Print out help info.

OPTIONS

-d, --debug    Print debug info. Default: false
-v, --version  Print CLI version. Default: false
-r, --red      The value for red. 0 to 255. Default: false
-g, --green    The value for green. 0 to 255. Default: false
-b, --blue     The value for blue. 0 to 255. Default: false

For hex-to-rgb:

COMMANDS

  help  Print out help info.

OPTIONS

 d, --debug    Print debug info. Default: false
-v, --version  Print CLI version. Default: false
-h, --hex      The hex value (3 or 6 characters) Default: false

Changelog

❯ Read the changelog here →

About

Simple color conversions from RGB to Hex and vice-versa.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published