forked from speedie/spmenu
Support 39 and 49, and fix 256 color support
This commit is contained in:
parent
33c8e169de
commit
023fe3af08
24
libs/draw.c
24
libs/draw.c
|
@ -235,7 +235,14 @@ int drawitemtext(struct item *item, int x, int y, int w) {
|
||||||
fg &= ~8;
|
fg &= ~8;
|
||||||
fgcol = txtcols[fg];
|
fgcol = txtcols[fg];
|
||||||
} else if (nextchar == 38) {
|
} else if (nextchar == 38) {
|
||||||
int r, g, b;
|
int r, g, b, c;
|
||||||
|
|
||||||
|
c = strtoul(c_character + 1, NULL, 10);
|
||||||
|
|
||||||
|
if (c == 5) {
|
||||||
|
bgfg = 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
strtoul(c_character + 1, &c_character, 10);
|
strtoul(c_character + 1, &c_character, 10);
|
||||||
|
|
||||||
|
@ -245,6 +252,9 @@ int drawitemtext(struct item *item, int x, int y, int w) {
|
||||||
|
|
||||||
fgcol = malloc(8 * sizeof(char));
|
fgcol = malloc(8 * sizeof(char));
|
||||||
snprintf(fgcol, 8, "#%02X%02X%02X", r, g, b);
|
snprintf(fgcol, 8, "#%02X%02X%02X", r, g, b);
|
||||||
|
} else if (nextchar == 39) {
|
||||||
|
fga = ofga;
|
||||||
|
fgcol = ofgcol;
|
||||||
} else if (nextchar >= 30 && nextchar <= 37) {
|
} else if (nextchar >= 30 && nextchar <= 37) {
|
||||||
fg = nextchar % 10 | (fg & 8);
|
fg = nextchar % 10 | (fg & 8);
|
||||||
fgcol = txtcols[fg];
|
fgcol = txtcols[fg];
|
||||||
|
@ -252,7 +262,14 @@ int drawitemtext(struct item *item, int x, int y, int w) {
|
||||||
bg = nextchar % 10;
|
bg = nextchar % 10;
|
||||||
bgcol = txtcols[bg];
|
bgcol = txtcols[bg];
|
||||||
} else if (nextchar == 48) {
|
} else if (nextchar == 48) {
|
||||||
int r, g, b;
|
int r, g, b, c;
|
||||||
|
|
||||||
|
c = strtoul(c_character + 1, NULL, 10);
|
||||||
|
|
||||||
|
if (c == 5) {
|
||||||
|
bgfg = 2;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
strtoul(c_character + 1, &c_character, 10);
|
strtoul(c_character + 1, &c_character, 10);
|
||||||
|
|
||||||
|
@ -262,6 +279,9 @@ int drawitemtext(struct item *item, int x, int y, int w) {
|
||||||
|
|
||||||
bgcol = malloc(8 * sizeof(char));
|
bgcol = malloc(8 * sizeof(char));
|
||||||
snprintf(bgcol, 8, "#%02X%02X%02X", r, g, b);
|
snprintf(bgcol, 8, "#%02X%02X%02X", r, g, b);
|
||||||
|
} else if (nextchar == 49) {
|
||||||
|
bga = obga;
|
||||||
|
bgcol = obgcol;
|
||||||
} else if (nextchar == 0) {
|
} else if (nextchar == 0) {
|
||||||
fgcol = ofgcol;
|
fgcol = ofgcol;
|
||||||
bgcol = obgcol;
|
bgcol = obgcol;
|
||||||
|
|
Loading…
Reference in a new issue