- These functions are implemented in
.:WrapTextInColorCode FrameXML/Util.lua
- These functions are implemented in
Wraps a string with |cffRRGGBB
and |r
escape sequences.
wrappedText = WrapTextInColorCode(text, colorHexString) wrappedText = color:WrapTextInColorCode(text)
Arguments[]
- text
- string - The text to wrap
- colorHexString
- string -
ff
followed by six hexadecimal digits as RRGGBB like the return from ColorMixin:GenerateHexColor().
Returns[]
- wrappedText
- string -
|cffRRGGBBtext|r
with the appropriate values inserted for RR, GG, BB and text.
Details[]
- Operates as a standalone function with two arguments, or as a method of ColorMixin with one argument.
Example[]
print("Did someone say " .. WrapTextInColorCode("yellow", "ffffff00") .. "?") -- Did someone say yellow?
Patch changes[]
- Patch 7.1.0 (2016-10-25): Added as a standalone function.[1]
- Patch 7.0.3 (2016-07-19): Added as a method of ColorMixin.[2]
References[]
- ^ 2016-10-25, Util.lua, version 7.1.0.22908, near line 25, archived at Townlong-Yak
- ^ 2016-07-19, Util.lua, version 7.0.3.22267, near line 621, archived at Townlong-Yak