Amazon.com Widgets

Color Converter

Now that we can use RGBA color declarations more universally (as long as you don’t care about IE, but who does? Anyone? Anyone?) I’ve been finding myself adapting to the new paradigm of writing colors in RGBA instead of my familiar Hexadecimal notation. And if I’m working over some existing CSS and need to add some alpha channel it’s been kind of a pain to convert them. So I created this plugin to quickly convert Hex colors to RGBA. And while I was at it I added a script to convert them to regular RGB as well. And then I figured I should be backwards compatible and wrote one for converting RGBA and RGB to Hex. Enjoy.

Installation Instructions

Download the file and put the plugin in your ~/Library/Application Support/Coda/Plug-ins/ folder. There’s no Step 2.

Usage Instructions

To use it just highlight a color declaration you want converted. Be sure to get the whole thing including the #/rgba(/rgb( at the beginning and the ) at the end, or you’ll get some left over items in your converted colors. Now just choose the conversion you want to perform from the Plug-ins menu under Color Converter. And viola! Your old colors are converted to the new format. If you converted to RGBA, you will note that the cursor is inserted at the point where you will enter your alpha value. Just type a number from 0-1 and you’re done.

Note that as of this release the scripts only work for Hex to RGBA/RGB or RGBA/RGB to Hex. Therefore, don’t try to convert RGB to RGBA or vice versa. It either won’t do anything or return some really interesting values. I’ll add some more robust checks later, but figured for a simple plug-in like this the extra effort wasn’t warranted.

FileDownload

Download

ProjectInfo

  • Version: 1.0
  • Released: February 18, 2010
  • Comments: 3

PreviousVersions

ShamelessBegging

Bandwidth isn't free, and creating things like this takes time. If you find these things useful then maybe you might consider making a small donation. It helps offset my bandwidth cost and will help me to keep improving them. Thanks.

Comments

Name:

Email:

URL:

Remember my personal information

Notify me of follow-up comments?

Posted by Jason  on  01/18  at  12:13 PM

This is great! Thanks for the awesome download and instructions. I will definitely utilize this.

Posted by Senne  on  11/09  at  08:10 AM

Hi, when I select rgb(255,0,0) and convert it to HEX, it outputs #ff00. Which is not correct!

Posted by Dave Beazer  on  01/21  at  05:56 AM

This is really cool, thanks!

How do I get it to work inline in HTML files though?  In the instructions you say you have modified the default modes… how do I go about doing that?

Thanks again.