I'm working with a game engine that uses escape codes in strings to perform commands such as setting color. eg to set the color to red, you write "Red text:\x81\xFF\x00\x00\xFFhello!" (0x81, red, green, blue, alpha).
Is it possible to create a macro like TEXT_COLOR(r,g,b,a) such that TEXT_COLOR(255,0,0,255) would expand to "\x81\xFF\x00\x00\xFF" for use in constant strings?
TEXT_COLOR(FF,00,00,FF)