I need to convert a OLE Color to and from a hex color for the web, kind of like the example here: Convert .Net Color Objects to HEX codes and Back
But the problem is I need to do it in Javascript, so how would I do that?
I need to convert a OLE Color to and from a hex color for the web, kind of like the example here: Convert .Net Color Objects to HEX codes and Back
But the problem is I need to do it in Javascript, so how would I do that?
Does JQuery Color fit the bill?
var rgba = $.Color("#ff0000").rgba()
gives [255,0,0,1]
You can get a single rgb int (ignoring alpha) out of that with:
(rgba[0] << 16) + (rgba[1] << 8) + rgba[2]