How do I get the hex color from an RGB color?

Viewed 427

I am reading an image and getting its colors in RGB via image/color. However, I want to convert a color to hex triplet. How do I do this?

img, err := jpeg.Decode(someImg)
color := img.At(x, y) # I would like to convert this from RGB to hex
1 Answers
Related