refactor: make background color optional

This commit is contained in:
Jan De Dobbeleer 2020-09-21 10:20:18 +02:00 committed by Jan De Dobbeleer
parent f5482dc1da
commit bbeba938f6
17 changed files with 23 additions and 104 deletions

View file

@ -8,7 +8,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"home_icon": "~", "home_icon": "~",
@ -19,7 +18,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#C2C206", "foreground": "#C2C206",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"branch_identical_icon": "≡", "branch_identical_icon": "≡",
@ -34,7 +32,6 @@
"type": "root", "type": "root",
"style": "plain", "style": "plain",
"foreground": "#B5B50D", "foreground": "#B5B50D",
"background": "#193549",
"properties": { "properties": {
"root_icon": "⚡" "root_icon": "⚡"
} }
@ -43,7 +40,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#C94A16", "foreground": "#C94A16",
"background": "#193549",
"properties": { "properties": {
"error_icon": "x" "error_icon": "x"
} }
@ -61,7 +57,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#007ACC", "foreground": "#007ACC",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"text": "▶" "text": "▶"
@ -70,6 +65,5 @@
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -8,7 +8,6 @@
"type": "session", "type": "session",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"user_info_separator": "", "user_info_separator": "",
"display_computer": false, "display_computer": false,
@ -20,7 +19,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"branch_identical_icon": "≡", "branch_identical_icon": "≡",
@ -37,7 +35,6 @@
"type": "root", "type": "root",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"root_icon": "⚡", "root_icon": "⚡",
"prefix": "<#CB4B16>[</>", "prefix": "<#CB4B16>[</>",
@ -48,7 +45,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"error_icon": "x", "error_icon": "x",
"prefix": "<#CB4B16>[</>", "prefix": "<#CB4B16>[</>",
@ -68,7 +64,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"home_icon": "~", "home_icon": "~",
"style": "short", "style": "short",
@ -79,6 +74,5 @@
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -8,7 +8,6 @@
"type": "time", "type": "time",
"style": "plain", "style": "plain",
"foreground": "#E5C07B", "foreground": "#E5C07B",
"background": "#193549",
"properties": { "properties": {
"time_format": "15:04:05", "time_format": "15:04:05",
"prefix": "[ ", "prefix": "[ ",
@ -19,7 +18,6 @@
"type": "root", "type": "root",
"style": "plain", "style": "plain",
"foreground": "#B5B50D", "foreground": "#B5B50D",
"background": "#193549",
"properties": { "properties": {
"root_icon": "⚡" "root_icon": "⚡"
} }
@ -28,7 +26,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#61AFEF", "foreground": "#61AFEF",
"background": "#193549",
"properties": { "properties": {
"home_icon": "~", "home_icon": "~",
"style": "agnoster", "style": "agnoster",
@ -39,7 +36,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#F3C267", "foreground": "#F3C267",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "🚦 ", "branch_icon": "🚦 ",
"display_status": true, "display_status": true,
@ -55,7 +51,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#C94A16", "foreground": "#C94A16",
"background": "#193549",
"properties": { "properties": {
"error_icon": "x" "error_icon": "x"
} }
@ -64,7 +59,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#E06C75", "foreground": "#E06C75",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"text": " " "text": " "
@ -73,6 +67,5 @@
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -9,7 +9,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"error_icon": " ", "error_icon": " ",
"postfix": "" "postfix": ""
@ -19,7 +18,6 @@
"type": "root", "type": "root",
"style": "plain", "style": "plain",
"foreground": "#100e23", "foreground": "#100e23",
"background": "#193549",
"properties": { "properties": {
"root_icon": "襁" "root_icon": "襁"
} }
@ -28,7 +26,6 @@
"type": "session", "type": "session",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"user_info_separator": "@" "user_info_separator": "@"
} }
@ -69,7 +66,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#007ACC", "foreground": "#007ACC",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"text": "" "text": ""
@ -77,6 +73,5 @@
} }
] ]
} }
], ]
"console_background_color": "#193549"
} }

View file

@ -8,7 +8,6 @@
"type": "session", "type": "session",
"style": "plain", "style": "plain",
"foreground": "#FFFFFF", "foreground": "#FFFFFF",
"background": "#193549",
"properties": { "properties": {
"user_info_separator": " <#ffffff>in</> ", "user_info_separator": " <#ffffff>in</> ",
"prefix": "<#0377C8># </>", "prefix": "<#0377C8># </>",
@ -20,7 +19,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#0973C0", "foreground": "#0973C0",
"background": "#193549",
"properties": { "properties": {
"home_icon": "~", "home_icon": "~",
"folder_icon": "", "folder_icon": "",
@ -33,7 +31,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#B8B80A", "foreground": "#B8B80A",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"branch_identical_icon": "≡", "branch_identical_icon": "≡",
@ -55,7 +52,6 @@
"type": "time", "type": "time",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"prefix": "[", "prefix": "[",
"postfix": "]" "postfix": "]"
@ -74,7 +70,6 @@
"type": "root", "type": "root",
"style": "plain", "style": "plain",
"foreground": "#CECE04", "foreground": "#CECE04",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"root_icon": "襁" "root_icon": "襁"
@ -84,7 +79,6 @@
"type": "virtualenv", "type": "virtualenv",
"style": "plain", "style": "plain",
"foreground": "#100e23", "foreground": "#100e23",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"python_icon": "" "python_icon": ""
@ -94,7 +88,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#CB4B16", "foreground": "#CB4B16",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"error_icon": "" "error_icon": ""
@ -104,7 +97,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#CC4B16", "foreground": "#CC4B16",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"text": "→" "text": "→"
@ -113,6 +105,5 @@
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -8,8 +8,8 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#F5F5F5", "foreground": "#F5F5F5",
"background": "#193549",
"properties": { "properties": {
"prefix": "",
"text": "ﬦ" "text": "ﬦ"
} }
}, },
@ -17,7 +17,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#B80101", "foreground": "#B80101",
"background": "#193549",
"properties": { "properties": {
"style": "agnoster" "style": "agnoster"
} }
@ -26,7 +25,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#B80101", "foreground": "#B80101",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"branch_identical_icon": "≡", "branch_identical_icon": "≡",
@ -41,6 +39,5 @@
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -8,7 +8,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"text": "<#C591E8>❭</><#69FF94>❭</>" "text": "<#C591E8>❭</><#69FF94>❭</>"
} }
@ -17,7 +16,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#56B6C2", "foreground": "#56B6C2",
"background": "#193549",
"properties": { "properties": {
"style": "folder" "style": "folder"
} }
@ -26,7 +24,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#D0666F", "foreground": "#D0666F",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"display_status": false, "display_status": false,
@ -38,7 +35,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#DCB977", "foreground": "#DCB977",
"background": "#193549",
"properties": { "properties": {
"error_icon": "✗", "error_icon": "✗",
"display_error_code": false "display_error_code": false
@ -48,7 +44,6 @@
"type": "time", "type": "time",
"style": "plain", "style": "plain",
"foreground": "#66F68F", "foreground": "#66F68F",
"background": "#193549",
"properties": { "properties": {
"time_format": "15:04" "time_format": "15:04"
} }
@ -56,6 +51,5 @@
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -82,7 +82,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#007ACC", "foreground": "#007ACC",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"text": "" "text": ""

View file

@ -8,7 +8,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"text": "<#C591E8>❭</><#69FF94>❭</>" "text": "<#C591E8>❭</><#69FF94>❭</>"
@ -18,7 +17,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#56B6C2", "foreground": "#56B6C2",
"background": "#193549",
"properties": { "properties": {
"style": "folder" "style": "folder"
} }
@ -27,7 +25,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#D0666F", "foreground": "#D0666F",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"display_status": false, "display_status": false,
@ -39,7 +36,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#DCB977", "foreground": "#DCB977",
"background": "#193549",
"properties": { "properties": {
"error_icon": "✗", "error_icon": "✗",
"display_error_code": false "display_error_code": false
@ -55,7 +51,6 @@
"type": "command", "type": "command",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"shell": "bash", "shell": "bash",
"command": "git log --pretty=format:%cr -1 || date +%H:%m:%S" "command": "git log --pretty=format:%cr -1 || date +%H:%m:%S"
@ -74,15 +69,13 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"text": " " "text": ""
} }
} }
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -91,7 +91,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#D4E157", "foreground": "#D4E157",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"error_icon": "", "error_icon": "",
@ -102,7 +101,5 @@
} }
] ]
} }
], ]
"console_background_color": "#193549",
"end_space_enabled": true
} }

View file

@ -9,7 +9,6 @@
"type": "time", "type": "time",
"style": "plain", "style": "plain",
"foreground": "#00C5C7", "foreground": "#00C5C7",
"background": "#193549",
"properties": { "properties": {
"time_format": "15:04:05" "time_format": "15:04:05"
} }
@ -28,7 +27,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#77E4F7", "foreground": "#77E4F7",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"home_icon": "~", "home_icon": "~",
@ -39,8 +37,8 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#FFE700", "foreground": "#FFE700",
"background": "#193549",
"properties": { "properties": {
"prefix": "",
"branch_icon": "", "branch_icon": "",
"branch_identical_icon": "≡", "branch_identical_icon": "≡",
"branch_ahead_icon": "↑", "branch_ahead_icon": "↑",
@ -54,14 +52,12 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#43D426", "foreground": "#43D426",
"background": "#193549",
"properties": { "properties": {
"prefix": "",
"text": "" "text": ""
} }
} }
] ]
} }
], ]
"console_background_color": "#193549",
"end_space_enabled": true
} }

View file

@ -9,7 +9,6 @@
"type": "root", "type": "root",
"style": "plain", "style": "plain",
"foreground": "#FFEE58", "foreground": "#FFEE58",
"background": "#193549",
"properties": { "properties": {
"root_icon": "襁" "root_icon": "襁"
} }
@ -18,7 +17,6 @@
"type": "session", "type": "session",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"user_info_separator": "@" "user_info_separator": "@"
} }

View file

@ -8,16 +8,15 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#98C379", "foreground": "#98C379",
"background": "#193549",
"properties": { "properties": {
"text": "→" "text": "→",
"postfix": ""
} }
}, },
{ {
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#56B6C2", "foreground": "#56B6C2",
"background": "#193549",
"properties": { "properties": {
"style": "folder" "style": "folder"
} }
@ -26,7 +25,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#D0666F", "foreground": "#D0666F",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"display_status": false, "display_status": false,
@ -38,7 +36,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#DCB977", "foreground": "#DCB977",
"background": "#193549",
"properties": { "properties": {
"error_icon": "✗", "error_icon": "✗",
"display_error_code": false "display_error_code": false
@ -47,6 +44,5 @@
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -8,7 +8,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#CB4B16", "foreground": "#CB4B16",
"background": "#193549",
"properties": { "properties": {
"error_icon": "" "error_icon": ""
} }
@ -17,7 +16,6 @@
"type": "root", "type": "root",
"style": "plain", "style": "plain",
"foreground": "#CECE04", "foreground": "#CECE04",
"background": "#193549",
"properties": { "properties": {
"root_icon": "襁" "root_icon": "襁"
} }
@ -26,7 +24,6 @@
"type": "session", "type": "session",
"style": "plain", "style": "plain",
"foreground": "#FFFFFF", "foreground": "#FFFFFF",
"background": "#193549",
"properties": { "properties": {
"user_info_separator": "@" "user_info_separator": "@"
} }
@ -35,7 +32,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#0973C0", "foreground": "#0973C0",
"background": "#193549",
"properties": { "properties": {
"home_icon": "", "home_icon": "",
"folder_icon": "", "folder_icon": "",
@ -48,7 +44,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#C1C106", "foreground": "#C1C106",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"branch_identical_icon": "≡", "branch_identical_icon": "≡",
@ -64,7 +59,6 @@
"type": "virtualenv", "type": "virtualenv",
"style": "plain", "style": "plain",
"foreground": "#100e23", "foreground": "#100e23",
"background": "#193549",
"properties": { "properties": {
"python_icon": "" "python_icon": ""
} }
@ -73,14 +67,12 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"prefix": "",
"text": "<#CB4B16>❭</><#CACA02>❭</><#4E9A06>❭</>" "text": "<#CB4B16>❭</><#CACA02>❭</><#4E9A06>❭</>"
} }
} }
] ]
} }
], ]
"console_background_color": "#193549",
"end_space_enabled": true
} }

View file

@ -8,7 +8,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#ffffff", "foreground": "#ffffff",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"home_icon": "~", "home_icon": "~",
@ -20,7 +19,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#F3C267", "foreground": "#F3C267",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"display_status": false, "display_status": false,
@ -31,7 +29,6 @@
"type": "command", "type": "command",
"style": "plain", "style": "plain",
"foreground": "#C49EE9", "foreground": "#C49EE9",
"background": "#193549",
"properties": { "properties": {
"shell": "bash", "shell": "bash",
"command": "find . -name package.json -depth 1 -exec echo \" <#ffffff>via node</>\" \\;" "command": "find . -name package.json -depth 1 -exec echo \" <#ffffff>via node</>\" \\;"
@ -41,7 +38,6 @@
"type": "root", "type": "root",
"style": "plain", "style": "plain",
"foreground": "#B5B50D", "foreground": "#B5B50D",
"background": "#193549",
"properties": { "properties": {
"root_icon": "⚡" "root_icon": "⚡"
} }
@ -50,7 +46,6 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#C94A16", "foreground": "#C94A16",
"background": "#193549",
"properties": { "properties": {
"error_icon": "x" "error_icon": "x"
} }
@ -68,7 +63,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#63F08C", "foreground": "#63F08C",
"background": "#193549",
"properties": { "properties": {
"prefix": "", "prefix": "",
"text": "→" "text": "→"
@ -76,7 +70,5 @@
} }
] ]
} }
], ]
"console_background_color": "#193549",
"end_space_enabled": true
} }

View file

@ -8,7 +8,6 @@
"type": "session", "type": "session",
"style": "plain", "style": "plain",
"foreground": "#E36464", "foreground": "#E36464",
"background": "#193549",
"properties": { "properties": {
"user_info_separator": "", "user_info_separator": "",
"display_computer": false, "display_computer": false,
@ -19,7 +18,6 @@
"type": "text", "type": "text",
"style": "plain", "style": "plain",
"foreground": "#62ED8B", "foreground": "#62ED8B",
"background": "#193549",
"properties": { "properties": {
"text": "→", "text": "→",
"postfix": "", "postfix": "",
@ -30,7 +28,6 @@
"type": "path", "type": "path",
"style": "plain", "style": "plain",
"foreground": "#56B6C2", "foreground": "#56B6C2",
"background": "#193549",
"properties": { "properties": {
"style": "folder", "style": "folder",
"postfix": "" "postfix": ""
@ -40,7 +37,6 @@
"type": "git", "type": "git",
"style": "plain", "style": "plain",
"foreground": "#D4AAFC", "foreground": "#D4AAFC",
"background": "#193549",
"properties": { "properties": {
"branch_icon": "", "branch_icon": "",
"display_status": false, "display_status": false,
@ -52,15 +48,14 @@
"type": "exit", "type": "exit",
"style": "plain", "style": "plain",
"foreground": "#DCB977", "foreground": "#DCB977",
"background": "#193549",
"properties": { "properties": {
"error_icon": "✗", "error_icon": "✗",
"display_error_code": false "display_error_code": false,
"postfix": ""
} }
} }
] ]
} }
], ],
"console_background_color": "#193549",
"end_space_enabled": true "end_space_enabled": true
} }

View file

@ -14,9 +14,15 @@ type ColorWriter struct {
} }
func (w *ColorWriter) writeColoredText(background string, foreground string, text string) { func (w *ColorWriter) writeColoredText(background string, foreground string, text string) {
style := color.HEXStyle(foreground, background) var coloredText string
text = style.Sprint(text) if background != "" {
w.Buffer.WriteString(text) style := color.HEXStyle(foreground, background)
coloredText = style.Sprint(text)
} else {
style := color.HEX(foreground)
coloredText = style.Sprint(text)
}
w.Buffer.WriteString(coloredText)
} }
func (w *ColorWriter) writeAndRemoveText(background string, foreground string, text string, textToRemove string, parentText string) string { func (w *ColorWriter) writeAndRemoveText(background string, foreground string, text string, textToRemove string, parentText string) string {
@ -25,9 +31,6 @@ func (w *ColorWriter) writeAndRemoveText(background string, foreground string, t
} }
func (w *ColorWriter) write(background string, foreground string, text string) { func (w *ColorWriter) write(background string, foreground string, text string) {
style := color.HEXStyle(foreground, background)
text = style.Sprint(text)
r := regexp.MustCompile(`<\s*(?P<color>#[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})>(?P<text>.*?)<\s*/\s*>`) r := regexp.MustCompile(`<\s*(?P<color>#[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})>(?P<text>.*?)<\s*/\s*>`)
match := r.FindAllStringSubmatch(text, -1) match := r.FindAllStringSubmatch(text, -1)
for i := range match { for i := range match {