Closed LambdaSix closed 5 years ago
Decided to mimic VT100 control sequences with full RGB encoding.
// Expected format: '\x1B[255;0;0#0;0;0mRed Text\x1B[0;0;0#0;0;0m'
// '\x1B[FORE_RED;FORE_GREEN;FORE_BLUE#BACK_RED;BACK_GREEN;BACK_BLUEm' -- specify fore/back colours
// '\x1B[FORE_RED;FORE_GREEN;FORE_BLUEm' -- default to black background or whatever 'back' is passed as
The Surface::PrintString() family of methods could benefit from being able to encode colour into the string itself as well as setting the foreground/background colours via the method.
Something like:
"This is a string with a <color f:Red>Named Red</color> section"
"This is a string with a <color f:#DDDDDD>Grey Hexcode</color> section"
"This is a string with a <color b:DarkGrey>Dark Grey Background</color> section"
"This is a string with a <color f:(255,0,0) b:(0,0,255)>Blue Background And Red Text</color> section"
Once the initial parser for extracting the HTML style tags is written, it should be simple to add , , and such depending on font support.
This would also necessitate Issue #2 to allow fonts with those types of styling.