Color RGB int to hex Given three integers rgb, output hexadecimal representation as a string.

Input:          Output:
72 61 139       #483D8B
75 0 130        #4B0082
0 255 127       #00FF7F


Shortest most unorthodox code wins
Ruby

I was going more for the "unorthodox" part. ;)

10;a=    gets.   split
.  map  {|       x|  #x
"%02X"  %(  x.   to_i)
}; $&gt;   &lt;&lt;   ?#  &lt;&lt;  a[
00  ..   1+2].   join;


The font (on my web browser) is a bit tall, so it looks distorted, but it looks better in Courier New:



Sample run:

c:\a\ruby&gt;rgb2hex
255 100 0
#FF6400