Tyrulan
Ultra Cool Member
- Reaction score
- 37
I wrote this a long time ago.. figured it was worth posting. If you have comments, questions, or suggestions post below. Thanks!
EDIT: Updated library name and added TESH highlighting .j file.
EDIT: Updated TESH file and added shorter function reference.
JASS:
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~ Colors ~~ By Tyrulan ~~ Version 1.1.0 ~~
//
// The following code should be pretty self explanatory.
// The functions would be used as follows:
// Color_RED("Hello World!")
// Color_BLUE("Hello World!")
// etc.
//
// OR
//
// Clr_RED("Hello World!")
// Clr_BLUE("Hello World!")
// etc.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
library Colors
globals
private constant string C_RED = "|cffff0000"
private constant string C_BLUE = "|cff0000ff"
private constant string C_TEAL = "|cff00ffff"
private constant string C_PURPLE = "|cff400080"
private constant string C_YELLOW = "|cffffff00"
private constant string C_ORANGE = "|cffff8000"
private constant string C_GREEN = "|cff00ff00"
private constant string C_PINK = "|cffff0080"
private constant string C_GRAY = "|cffc0c0c0"
private constant string C_GREY = "|cffc0c0c0"
private constant string C_LIGHTBLUE = "|cff0080c0"
private constant string C_DARKGREEN = "|cff008000"
private constant string C_BROWN = "|cff400000"
// ************************************
private constant string C_HINT = "|cff32cd32"
private constant string C_WARNING = "cffff0000"
private constant string C_NOTICE = "|cff995500"
private constant string C_CLOSE = "|R"
endglobals
//! textmacro COLOR takes TYPEWORD
function Color_$TYPEWORD$ takes string s returns string
return C_$TYPEWORD$ + s + C_CLOSE
endfunction
function Clr_$TYPEWORD$ takes string s returns string
return C_$TYPEWORD$ + s + C_CLOSE
endfunction
//! endtextmacro
//! runtextmacro COLOR("RED")
//! runtextmacro COLOR("BLUE")
//! runtextmacro COLOR("TEAL")
//! runtextmacro COLOR("PURPLE")
//! runtextmacro COLOR("YELLOW")
//! runtextmacro COLOR("ORANGE")
//! runtextmacro COLOR("GREEN")
//! runtextmacro COLOR("PINK")
//! runtextmacro COLOR("GRAY")
//! runtextmacro COLOR("GREY")
//! runtextmacro COLOR("LIGHTBLUE")
//! runtextmacro COLOR("DARKGREEN")
//! runtextmacro COLOR("BROWN")
//! runtextmacro COLOR("HINT")
//! runtextmacro COLOR("WARNING")
//! runtextmacro COLOR("NOTICE")
endlibrary
EDIT: Updated library name and added TESH highlighting .j file.
EDIT: Updated TESH file and added shorter function reference.