Menu

rgbHex.js

About

A simple yet intelligent rgb / hex converter for JavaScript (~1.06 Kb minified).

Convert

Enter rgb or hex value:

Examples

rgba(255, 255, 255, 0) => #FFFFFF
rgba(255, 255, 255)    => #FFFFFF
rgb(255,255,255,0)     => #FFFFFF
rgb(255,255,255);      => #FFFFFF
rgb(255,255,255)       => #FFFFFF
255,255,255,0          => #FFFFFF
255,255,255            => #FFFFFF
      
#FFFFFF => rgb(255,255,255)
#ffffff => rgb(255,255,255)
#fFfFfF => rgb(255,255,255)
FFFFFF  => rgb(255,255,255)
#FFF    => rgb(255,255,255)
FFF     => rgb(255,255,255)
      

About

The converter will automatically detect the input format and auto convert it allowing you to enter either a rgb or hex value as input. Note that any white space before and after the entire or string or individual numbers are acceptable. Also lower and upper case letters for hex values are also both acceptable.

Related Plugins

Resources