Color to Hex Code converter?

Hey all.

I am wondering if I can convert a color variable to a hex code, and vice versa? I am building a in-game tool that lets you choose the color of your mesh and I think a hex code would be a good option to include. I did a cursory search online and couldn’t find anything that would work in blueprints.

Thanks in advance!

well hexcode is basicly the 4 components, in hexadecimal.
for exemple
#FFFFFFFF means red :255 green : 255 blue:255 alpha 255
but the hardest part should be to handle the color profile (srgb, rec709, rec2020 …) as you ll have to handle Gamma and color convertion from linear

If I could calculate the hex code myself that would also be great but I don’t know the algorithm. If I had the algorithm it probably wouldn’t be too hard to implement into Unreal

if the goal is to create a color picker, you can do it without using the hex code.
you can create a color wheel and use it as a picker :

I already made a color wheel, the problem is that if you want an exact perfect color in mind, going down and trying to click on the exact, perfect pixel would be difficult, so just pasting in a HEX would be a good solution. It’s almost next to impossible to get multiple pieces to be the same color as the previous problem would also apply. Once again, just selecting a color, then copying the HEX code it generates and pasting it into the other piece would solve the problem

Any chance you were able to get this working? I’ve been trying to implement the same thing but haven’t had any luck and there’s not much online that can help.