Convert from RGB to HEX Color Formats

Web colors are commonly represented using a hex-triplet. A hex-color is specified using a string of the form #rrggbb, where rr is the hexadecimal representation of the red component of the color given in the interval [0,255], and the same for the green gg and the blue bb components. For example, the color magenta is given by #ff00ff. This application implements a function to convert an rgb color to a hex-triplet. It is possible to choose different color scales. By moving the mouse over the color scale, one can see the colors' corresponding hex-code and rgb values.

It is possible to choose different color scales. By moving the mouse over the color scale one can see the corresponding hex-code and rgb values of the colors.



The JavaScript Code