So I’ve recently trying to make rich text color on specific item like yellow color text is for yellow trail, blue color text is for blue trail. But I’m getting stuck and confused how do i do it.
No errors in output
ownedTrailsFolder.ChildAdded:Connect(function(item)
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 rgbText = rgb255RichText(Color3.fromRGB(item.Color))
script.Parent.NotificationBar.Text = [[Purchased New Item: <font color="]] .. rgbText .. [["\>"]] .. item.Name .. " Trail</font>"
end)
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
The whole RGB * 255 is useless because RGB caps out at 255 and no matter what value you pass it will either be white or black.
Assuming your item color is generated using Color3 you can just pass in item.Color as your argument for rgb255RichText.
local function rgb255RichText(color3)
return string.format("rgb(%d, %d, %d)", color3.R,color3.G, color3.B)
end
'R' is not a member of ColorSequence
Stack Begin
Script 'Players.Humaidi_0.PlayerGui.ScreenGui.TrailGuiHandler', Line 127 - function rgb255RichText
Script 'Players.Humaidi_0.PlayerGui.ScreenGui.TrailGuiHandler', Line 130
Stack End