News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

AnyExample.com:
Convert RGB from/to HTML hex color
November 16, 2006 @ 07:47:00

On AnyExample.com, there's a quick little tutorial demonstrating how to convert an RGB value passed into a function into the corresponding HTML hex color.

There are actually two functions - one for hex to rgb and the other for rgb to hex (though it's not a far leap to make a wrapper function that handles the value correctly by detecting the format - a string or array). They give the code for both of the functions and a bit of sample code for the PHP it could be embedded in.

The only real place I can think of using something like this is in a web-based graphics application - maybe for color-matching or something. More often than not, though, simple software like Huey for Windows can provide you the same information (and more).

Any other applications you all can think of?

0 comments voice your opinion now!
convert rgb hex html color graphic wrapper convert rgb hex html color graphic wrapper


blog comments powered by Disqus

Similar Posts

Vinu Thomas' Blog: Replace print_r and var_dump with Krumo

PHPBuilder.com: AJAX and PHP Part 4 - Forms and JavaScript Limitations

php|architect Blog: WordPress 404 Plugin built on Bing Wrapper

DevShed: User-defined Interfaces in PHP 5 - Turning MySQL Classes into Interface Implementers

Tim Koschuetzki's Blog: How To Transform HTML To Textile Markup - The CakePHP TextileHelper Revisite


Community Events





Don't see your event here?
Let us know!


podcast symfony version laravel community voicesoftheelephpant unittest series language framework introduction opinion release extension interview configure composer conference api list

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework