If I run some color processing function, like:

Blend[RGBColor /@ {"#DC4E00", "#000000", "#822250", "#FCC11B"}]

I get back a RGBColor object:

RGBColor[0.5901960784313726, 0.29901960784313725, 0.10490196078431373]

Is there a simple way to convert that RGBColor to an HTML string, like:


Seems like the function I was wanting was:

hexifyColor[color_RGBColor] := 
  StringJoin["#", IntegerString[Round[Level[color, 1]*255], 16, 2]]

It is there, deep down, but I'm too lazy to dig...

hexColor = StringCases[
    ExportString[Style[1, #], "HTMLFragment"], 
    "color:" ~~ color__ ~~ "\"" :> color
][[1]] &


Not the answer you're looking for? Browse other questions tagged or ask your own question.