Return to Snippet

Revision: 17355
at September 1, 2009 19:16 by scopefragger

Initial Code
function rgb2hex($rgb){
   return sprintf("%06X", $rgb);

Initial URL

Initial Description
Ever needed to convert rgb to hex on your website, maybe you have a slider that handles rgb but your backend uses hex,  this issue can be resolved easily be using the following code.  Remember to keep in mind that php and html primarily uses hex colors.

Initial Title
Convert RGB to HEX

Initial Tags

Initial Language