hc: Hex Color Command-Line Tool for OS X

I’ve been working a lot lately with LESS and Bootstrap, and wanted an easier and quicker way to visualize colors and what the various LESS operations do to them. So, I built hc — Hex Colors on the Command Line. It’s written in Objective-C and works on Mac OS X 10.9+.

It’s still in its infancy, of course, but it lets you do things like show, lighten, or darken colors. To show the color red, for example, type:

hc show f00

That will display, in your console, the text:

hex: #ff0000
rgb: 255, 0, 0
hsl: 0°, 100%, 50%

You can pass 3- or 6-character hex codes. You can also change the output format using the -o/--output option. To write the color to an image file, for example, type:

hc show f00 --output file

This will create a 256×256 PNG file in your current directory called ff0000.png that looks like this:

Ff0000

You can also write the textual results to the clipboard using -o clip, or to a user notification (thanks for the idea, Rob!) using -o note. The notification looks like this:

ITermScreenSnapz002

Be sure to read the README for more information. Check it out and give me feedback!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.