Adding Color to your Words
|Main Page LuaArcEmu Website ArcEmu Forum Bug Tracker|
Adding Color to things can make them look much more better.
Coloring your in-game text
You can color the text that comes from Broadcast Messages, Gossip Menu Options, and more! It's done by using Hexadecimal Color Codes
You can find these codes here:
Each code corresponds to what color will be displayed. Here is a list of basic colors:
RED = FF0000 GREEN = 00FF00 BLUE = 0000FF ORANGE = FFCC00 PURPLE = CC00CC YELLOW = FFFF00 BROWN = CC6600 BLACK = 000000 WHITE = FFFFFF
To color your text in-game you must use |c to begin the color code and |r to end it. Also use two F's after the |c in order to get the correct color.
function OnPlayerDied(event, player) player:SendBroadcastMessage("|cFFFFCC00You have died,|r |cFFCC6600"..player:GetName()..".|r") end RegisterServerHook(6, "OnPlayerDied")
Sends you the message You have died, <Player Name>
I used two color codes: Orange and Brown. Before writing the color codes I used two F's.
Coloring your Console
Coloring your console is very simple and doesn't require Hexadecimal Color Codes, it requires the use of the global function called logcol.
There is 3 colors that can be used in logcol and one that brightens the color.
BLUE = 1 GREEN = 2 RED = 4 BRIGHTEN = 8
These can be added together though, Example: Red(4) + Blue(1) = Purple(5).
logcol(5) print("Purple") logcol(1) print("Blue") logcol(9) print("Bright Blue")