You won’t be able to dynamically change the colour just by extracting the colour value you want your text and assigning it to a variable. You would have to update the text field every time you make a change. Additionally the RGB values held in a Color3 object are read 0-1 so you might find it more favourable to store the raw RGB values themselves as variables or just not go this route to begin with.
Color3 has an upcoming method, ToHex, that would make it a lot easier to inline the colour change.
It’s not “currently” impossible, it’s never been possible and won’t ever be. With or without rich text, the Text property doesn’t automatically update. You’re responsible for making updates to the Text property whenever you change a variable or want Text to read something new and that includes something like updating rich text tags which in themselves are part of the Text but are rendered differently.
I think i explained it wrong, I want the color tag value to be a custom color3 rgb value, it’s just an example of setting that tag to color from variable
Same thing as my first response then, but multiply each of the RGB values by 255 and inline it.
local function rgb255RichText(color3)
local R = (color3.R * 255)
local G = (color3.G * 255)
local B = (color3.B * 255)
return string.format("rgb(%d, %d, %d)", R, G, B)
end
local customColor = Color3.fromRGB(255, 0, 255)
-- We're assuming that you won't immediately have access to the values you
-- feed into a Color3, otherwise you can just make these local variables
-- and construct the Color3 with them as well as feed them directly into
-- the RichText.
local rgbText = rgb255RichText(customColor)
textLabel.Text = [[<font color="]] .. rgbText .. [[">.."sample text"..</font>]]