Smooth coloring effect on textlabel text

Hello everyone !

Im currently trying to make the text of the textlabel to be smoothly colored ( from black to white and again black ) but only 1 word to be smoothly colored from the hole message.

But the best i manage to do is coloring letter by letter.

Tried with Rich text, Ui gradient ( but it color the GUI ) after seen other methods with the gradient but still didnt work and with Color3.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local textLabel = script.Parent
local TitleEquipEvent = ReplicatedStorage.Titles:WaitForChild("TitleEquip")

local titleColors = {
    -- Rank Titles
    ["Starter"] = "#EEEEEE", 
    ["Rookie"] = "#36A236", 
    ["Beginner"] = "#3D79B6",
    ["Novice"] = "#8743CA",  
    ["Amateur"] = "#CECE2C", 
    ["Learner"] = "#A30D1F", 
    ["Recruit"] = "#23082A",

    -- Special Titles
    ["Developer"] = "special"
}

textLabel.RichText = true

local defaultText = string.format('<stroke color="#000000" thickness="2" transparency="0">%s: Test</stroke>', player.Name)

TitleEquipEvent.OnClientEvent:Connect(function(equippedPlayer, title)
    if equippedPlayer == player then
        if title == "Developer" then
          

            textLabel.Text = string.format(
                '<stroke color="#000000" thickness="2" transparency="0">' ..
                '<font color="#000000">D</font>' ..
                '<font color="#222222">e</font>' .. 
                '<font color="#444444">v</font>' ..
                '<font color="#666666">e</font>' ..
                '<font color="#888888">l</font>' .. 
                '<font color="#AAAAAA">o</font>' ..
                '<font color="#CCCCCC">p</font>' .. 
                '<font color="#FFFFFF">e</font>' .. 
                '<font color="#CCCCCC">r </font>' ..
                '%s: Test</stroke>',
                player.Name
            )
        else
            -- For all other titles, use RichText with predefined colors
            textLabel.RichText = true
            local titleColor = titleColors[title] or "#FFFFFF"
            textLabel.Text = string.format(
                '<stroke color="#000000" thickness="2" transparency="0"><font color="%s">[%s]</font> %s: Test</stroke>',
                titleColor, title, player.Name
            )
        end
    else
        textLabel.Text = defaultText
    end
end)

textLabel.Text = defaultText

image

Im trying to achive an effect like on the screenshot i sent.

This effect is most definitely obtained through a UIGradient effect, not through RichText. You most likely just have your hierarchy wrong for actually using the instance.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.