Merge branch 'fix-color-cube'

Closes #479
This commit is contained in:
Daniel Eklöf 2021-05-06 14:06:43 +02:00
commit 8cb95018c0
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 10 additions and 3 deletions

View file

@ -70,6 +70,8 @@
* `generate-alt-random-writes.py --sixel` sometimes crashing,
resulting in PGO build failures.
* Wrong colors in the 256-color cube
(https://codeberg.org/dnkl/foot/issues/479).
### Security

View file

@ -2318,15 +2318,20 @@ config_load(struct config *conf, const char *conf_path,
for (size_t r = 0; r < 6; r++) {
for (size_t g = 0; g < 6; g++) {
for (size_t b = 0; b < 6; b++) {
uint8_t red = r ? r * 40 + 55 : 0;
uint8_t green = g ? g * 40 + 55 : 0;
uint8_t blue = b ? b * 40 + 55 : 0;
conf->colors.table[16 + r * 6 * 6 + g * 6 + b]
= r * 51 << 16 | g * 51 << 8 | b * 51;
= red << 16 | green << 8 | blue << 0;
}
}
}
/* And finally 24 shades of gray */
for (size_t i = 0; i < 24; i++)
conf->colors.table[232 + i] = i * 11 << 16 | i * 11 << 8 | i * 11;
for (size_t i = 0; i < 24; i++) {
uint8_t level = i * 10 + 8;
conf->colors.table[232 + i] = level << 16 | level << 8 | level << 0;
}
}
conf->notify.raw_cmd = xstrdup(