aboutsummaryrefslogtreecommitdiffstats
path: root/terms.c
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-07-08 17:17:30 +0000
committerterminaldweller <thabogre@gmail.com>2022-07-08 17:17:30 +0000
commit4d7d95cf6858aaab092adf90cc3768ccb81f3ba9 (patch)
treecef35b61db443dd560c1484d436701cb7c46bf29 /terms.c
parentchanges the colors. (diff)
downloadw3m-4d7d95cf6858aaab092adf90cc3768ccb81f3ba9.tar.gz
w3m-4d7d95cf6858aaab092adf90cc3768ccb81f3ba9.zip
a temp hacky fix for the colors
Diffstat (limited to '')
-rw-r--r--terms.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/terms.c b/terms.c
index deca179..2ece7bd 100644
--- a/terms.c
+++ b/terms.c
@@ -1679,8 +1679,44 @@ static char *
color_seq(int colmode)
{
static char seqbuf[32];
- /* sprintf(seqbuf, "\033[%dm", ((colmode >> 8) & 7) + 30); */
- sprintf(seqbuf, "\x1b[38;5;%dm", ((colmode >> 8) & 7) + 30);
+ int color = ((colmode >> 8) & 7);
+ switch(color) {
+ case 1:
+ // WHITE
+ sprintf(seqbuf, "\x1b[38;5;23m");
+ break;
+ case 2:
+ // RED
+ sprintf(seqbuf, "\x1b[38;5;203m");
+ break;
+ case 3:
+ // GREEN
+ sprintf(seqbuf, "\x1b[38;5;28m");
+ break;
+ case 4:
+ // BLUE
+ sprintf(seqbuf, "\x1b[38;5;33m");
+ break;
+ case 5:
+ //
+ sprintf(seqbuf, "\x1b[38;5;62m");
+ break;
+ case 6:
+ // CYAN
+ sprintf(seqbuf, "\x1b[38;5;37m");
+ break;
+ case 7:
+ sprintf(seqbuf, "\x1b[38;5;122m");
+ break;
+ default:
+ sprintf(seqbuf, "\033[%dm", ((colmode >> 8) & 7) + 30);
+ }
+ /* if (color == 1) { */
+ /* sprintf(seqbuf, "\x1b[38;5;23m"); */
+ /* } else { */
+ /* sprintf(seqbuf, "\033[%dm", ((colmode >> 8) & 7) + 30); */
+ /* } */
+ /* sprintf(seqbuf, "\x1b[38;5;%dm", ((colmode >> 8) & 7) + 22); */
return seqbuf;
}