LambdaSix / RenderLike

C# MonoGame based console emulator in the spirit of libtcod
MIT License
1 stars 0 forks source link

Colour support inside strings #3

Closed LambdaSix closed 5 years ago

LambdaSix commented 8 years ago

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:

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.

LambdaSix commented 6 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