Colors
These functions let you choose colors of different elements of the output text.
SetStyleColors(style, txt[, bkg=0xffffff])
SetUserInputColors(txt[, bkg=0xffffff]) SetStdOutColors(txt[, bkg=0xffffff]) SetStdErrColors(txt[, bkg=0xffffff]) SetCommentColors(txt[, bkg=0xffffff]) SetNumberColors(txt[, bkg=0xffffff]) SetKeywordColors(txt[, bkg=0xffffff]) SetNameColors(txt[, bkg=0xffffff]) SetStringColors(txt[, bkg=0xffffff]) SetPunctuationColors(txt[, bkg=0xffffff]) SetWarningCommentColors(txt[, bkg=0xffffff])
SetStyleColors(style, txt[, bkg])
This is the main color setting function. It takes three parameters. The first parameter - style - is mandatory and defines the style for which the colors will be set. The following styles are available (these are not defined in Lua so you either have to use numeric values or, better, the Set...Colors() functions described below):
#define STYLE_USERINPUT 0 // user input #define STYLE_STDOUT 1 // StdOut, used by print() #define STYLE_STDERR 2 // StdErr, used for error messages #define STYLE_COMMENT 3 // single-line and multiline comments #define STYLE_NUMBER 4 // numbers #define STYLE_TYPE 5 // type of variable #define STYLE_NAME 6 // name of variable #define STYLE_STRING 7 // string constants #define STYLE_PUNCTUATION 8 // punctuation characters #define STYLE_WARNING 9 // warningsThe secons parameter - txt - is mandatory and defines color of text for given style. It must be defined in standard 0xbbggrr form. The last parameter - bkg - is optional and defines the color of the text background. The same 0xbbggrr form is used for this parameter. If it is not present, then white background (0xffffff) is used.
These functions just call the SetStyleColors() function internally passing the appropriate style parameter so that you don't have to remember the STYLE_... constants (which are not defined in Lua anyway). The txt and bkg parameters are identical to those in the latter function.