mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-17 22:05:22 -05:00
osc: fix indexing into 'bright' color array
This commit is contained in:
parent
52ece3592c
commit
65e4b93a03
1 changed files with 3 additions and 3 deletions
6
osc.c
6
osc.c
|
|
@ -293,7 +293,7 @@ osc_dispatch(struct terminal *term)
|
|||
if (strlen(string) == 1 && string[0] == '?') {
|
||||
uint32_t color =
|
||||
(idx >= 0 && idx < 8) ? term->colors.regular[idx] :
|
||||
(idx >= 8 && idx < 16) ? term->colors.bright[idx] :
|
||||
(idx >= 8 && idx < 16) ? term->colors.bright[idx - 8] :
|
||||
term->colors.colors256[idx];
|
||||
|
||||
uint8_t r = (color >> 16) & 0xff;
|
||||
|
|
@ -388,7 +388,7 @@ osc_dispatch(struct terminal *term)
|
|||
if (idx >= 0 && idx < 8)
|
||||
term->colors.regular[idx] = term->colors.default_regular[idx];
|
||||
else if (idx >= 8 && idx < 16)
|
||||
term->colors.bright[idx] = term->colors.default_bright[idx];
|
||||
term->colors.bright[idx - 8] = term->colors.default_bright[idx - 8];
|
||||
else if (idx < 256)
|
||||
term->colors.colors256[idx] = term->colors.default_colors256[idx];
|
||||
idx = 0;
|
||||
|
|
@ -402,7 +402,7 @@ osc_dispatch(struct terminal *term)
|
|||
if (idx >= 0 && idx < 8)
|
||||
term->colors.regular[idx] = term->colors.default_regular[idx];
|
||||
else if (idx >= 8 && idx < 16)
|
||||
term->colors.bright[idx] = term->colors.default_bright[idx];
|
||||
term->colors.bright[idx - 8] = term->colors.default_bright[idx - 8];
|
||||
else if (idx < 256)
|
||||
term->colors.colors256[idx] = term->colors.default_colors256[idx];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue