Printf is a function that allows you to print a formatted print. This formatting lets you change the color of the string in the middle of it. That's it.
Normally, it the function detects "\027" in the string, it analyzes the next two characters. If they are special, it changes the colors accordingly. Then it analyzes the 3rd and the 4th and changes the color accordingly. If you want to have the charcter "-" or "+" to be printed and it is 3 positions after "\027" then put "@" between the 2nd character after "\027" and the special character.
You can load it as an API, however, I do recommend you just copy the code into your own. Give credit! Printf does not go to the next line at the end of the string!
Usage:
Colors codes:
["0"] = colors.white,
["1"] = colors.orange,
["2"] = colors.magenta,
["3"] = colors.lightBlue,
["4"] = colors.yellow,
["5"] = colors.lime,
["6"] = colors.pink,
["7"] = colors.gray,
["8"] = colors.lightGray,
["9"] = colors.cyan,
["a"] = colors.purple,
["b"] = colors.blue,
["c"] = colors.brown,
["d"] = colors.green,
["e"] = colors.red,
["f"] = colors.black,
Text color and background color:
"+" = setTextColor
"-" = setBackgroundColor
Escape character:
"\027" = starts color magic
"@" = stops color magic before the fourth symbol
Wanna download?
pastebin get STwcktKR printf
Screenies: