mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-04-28 00:20:48 +00:00
Truecolor \B and \F tags
Developers could utilize the whole 16777216 colors instead of 4096, which is cool imo :D
This commit is contained in:
parent
011876bec5
commit
84f516f6a3
1 changed files with 15 additions and 1 deletions
|
|
@ -462,7 +462,13 @@ class MicronParser {
|
|||
state.formatting.italic = !state.formatting.italic;
|
||||
break;
|
||||
case 'F':
|
||||
// next 3 chars = fg color
|
||||
if (line[i+1] == "T" && line.length >= i+8) { // truecolor tags (`FTxxxxxx)
|
||||
let color = line.substr(i+2,6);
|
||||
state.fg_color = color;
|
||||
skip = 7;
|
||||
break;
|
||||
}
|
||||
// next 3 chars => bg color
|
||||
if (line.length >= i+4) {
|
||||
let color = line.substr(i+1,3);
|
||||
state.fg_color = color;
|
||||
|
|
@ -474,12 +480,20 @@ class MicronParser {
|
|||
state.fg_color = this.SELECTED_STYLES.plain.fg;
|
||||
break;
|
||||
case 'B':
|
||||
if (line[i+1] == "T" && line.length >= i+8) { // truecolor tags (`BTxxxxxx)
|
||||
let color = line.substr(i+2,6);
|
||||
state.bg_color = color;
|
||||
skip = 7;
|
||||
break;
|
||||
}
|
||||
// next 3 chars => bg color
|
||||
if (line.length >= i+4) {
|
||||
let color = line.substr(i+1,3);
|
||||
state.bg_color = color;
|
||||
skip = 3;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
// reset bg
|
||||
state.bg_color = this.DEFAULT_BG;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue