#Question about %c and Display Text coloring

6 messages · Page 1 of 1 (latest)

solemn estuary
#

Hey everyone,
I'm using a function that someone linked here for %c to color the target level based on difficulty:

    local skull="|TInterface\\TargetingFrame\\UI-TargetingFrame-Skull:0|t"
    local level=UnitLevel("target")
    local color=GetCreatureDifficultyColor(level)
    color=ConvertRGBtoColorString(color)
    return level<0 and skull or color..level
end```
> **Display Text** -> **%n [ %c ]**
But the closing bracket after %c in Display Text gets colored, too. Is it possible to separate the bracket somehow so I doesn't get recognized as part of %c and retains the normal text color?
indigo pike
#

change return line to:
return level<0 and skull or color..level.."|r"

#

!escape more info there if needed, "|r" is what stops it from coloring the rest of the text.

drifting mauveBOT
solemn estuary
#

thank you very much! didn't know I could use it like this ❤️

humble notch
#

@solemn estuary unrelated but update your addon!