How to add a Color3 value to a rich text string

I’ve got a table with a bunch of Color3 values and a function that chooses one of the colors from the table. I want to take that Color3 value and add it to a TextLabel with rich text.

So if the Color3 is Color3.fromRGB(255, 64, 67) I want the text in the TextLabel to be <font color="rgb(255, 64, 67)">Hello!</font>

1 Like

Edit: use “[[” and “]]” instead of quotes to declare the string

1 Like

i think

local color3
local str = '<font color="rgb('..color3.R*255..','..color3.G*255..','.. color3.R*255 ..')">Hello!</font>'
1 Like

This is fairly simple to achieve you just need to escape all " and ’ characters that you don’t intend to be the ends of the string otherwise the string will be cut short, to do that you use a backslash, like in the following:

local aString = "<font color=\"rgb(255, 64, 67)\">Hello!</font>"