diff options
author | Robin Jarry <robin@jarry.cc> | 2024-02-01 21:45:59 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-02-14 23:05:19 +0100 |
commit | b6fd647d7d51ceaf386a79da6d04f57e0a7deac2 (patch) | |
tree | 5b9995e05c92c0fda6e1c59295828741378a692a | |
parent | abfb20f1d62c511778f8ee811a3ff6a02e93a32f (diff) | |
download | aerc-b6fd647d7d51ceaf386a79da6d04f57e0a7deac2.tar.gz |
colorize: adapt default style for light backgrounds
The current default theme is unusable on light backgrounds. Some colors
are too light and are almost invisible.
Use only palette colors to ensure that everything is customizable by the
user.
I tested this with white on black, grey on dark purple, black on yellow,
black on white. Text remains readable everywhere.
Update stylesets that don't use these new defaults to explicitly
override them.
Changelog-changed: The default `colorize` theme has been changed to
use the base terminal colors.
Cc: Jason Cox <me@jasoncarloscox.com>
Reported-by: Matěj Cepl <mcepl@cepl.eu>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
-rw-r--r-- | filters/colorize.c | 26 | ||||
-rw-r--r-- | stylesets/blue | 30 | ||||
-rw-r--r-- | stylesets/default | 30 | ||||
-rw-r--r-- | stylesets/dracula | 5 | ||||
-rw-r--r-- | stylesets/pink | 30 |
5 files changed, 68 insertions, 53 deletions
diff --git a/filters/colorize.c b/filters/colorize.c index 01f2befc..36474ba9 100644 --- a/filters/colorize.c +++ b/filters/colorize.c @@ -160,19 +160,19 @@ static FILE *in_file; static bool osc8_urls; static const char *styleset; static struct styles styles = { - .url = { .underline = true, .fg = { .type = RGB, .rgb = 0xffffaf } }, - .header = { .bold = true, .fg = { .type = RGB, .rgb = 0xaf87ff } }, - .signature = { .dim = true, .fg = { .type = RGB, .rgb = 0xaf87ff } }, - .diff_meta = { .bold = true, .fg = { .type = RGB, .rgb = 0xffffff } }, - .diff_chunk = { .bold = true, .fg = { .type = RGB, .rgb = 0x00cdcd } }, - .diff_chunk_func = { .fg = { .type = RGB, .rgb = 0x00cdcd } }, - .diff_add = { .fg = { .type = RGB, .rgb = 0x00cd00 } }, - .diff_del = { .fg = { .type = RGB, .rgb = 0xcd0000 } }, - .quote_1 = { .fg = { .type = RGB, .rgb = 0x5fafff } }, - .quote_2 = { .fg = { .type = RGB, .rgb = 0xff8700 } }, - .quote_3 = { .fg = { .type = RGB, .rgb = 0xaf87ff } }, - .quote_4 = { .fg = { .type = RGB, .rgb = 0xff5fd7 } }, - .quote_x = { .fg = { .type = RGB, .rgb = 0x808080 } }, + .url = { .underline = true, .fg = { .type = PALETTE, .index = 3 } }, + .header = { .bold = true, .fg = { .type = PALETTE, .index = 4 } }, + .signature = { .dim = true, .fg = { .type = PALETTE, .index = 4 } }, + .diff_meta = { .bold = true }, + .diff_chunk = { .fg = { .type = PALETTE, .index = 6 } }, + .diff_chunk_func = { .dim = true, .fg = { .type = PALETTE, .index = 6 } }, + .diff_add = { .fg = { .type = PALETTE, .index = 2 } }, + .diff_del = { .fg = { .type = PALETTE, .index = 1 } }, + .quote_1 = { .fg = { .type = PALETTE, .index = 6 } }, + .quote_2 = { .fg = { .type = PALETTE, .index = 4 } }, + .quote_3 = { .dim = true, .fg = { .type = PALETTE, .index = 6 } }, + .quote_4 = { .dim = true, .fg = { .type = PALETTE, .index = 4 } }, + .quote_x = { .dim = true, .fg = { .type = PALETTE, .index = 5 } }, }; static inline bool startswith(const char *s, const char *prefix) diff --git a/stylesets/blue b/stylesets/blue index 4ffcbc87..0d474354 100644 --- a/stylesets/blue +++ b/stylesets/blue @@ -56,18 +56,18 @@ default.selected.bg=#005f87 completion_default.selected.bg=#005f87 -#[viewer] -#url.fg=#ffffaf -#url.underline=true -#header.fg=#af87ff -#signature.fg=#af87ff -#diff_meta.fg=#ffffff -#diff_meta.bold=true -#diff_chunk.fg=#00cdcd -#diff_add.fg=#00cd00 -#diff_del.fg=#cd0000 -#quote_1.fg=#5fafff -#quote_2.fg=#ff8700 -#quote_3.fg=#af87ff -#quote_4.fg=#ff5fd7 -#quote_x.fg=#808080 +[viewer] +url.fg=#ffffaf +url.underline=true +header.fg=#af87ff +signature.fg=#af87ff +diff_meta.fg=#ffffff +diff_meta.bold=true +diff_chunk.fg=#00cdcd +diff_add.fg=#00cd00 +diff_del.fg=#cd0000 +quote_1.fg=#5fafff +quote_2.fg=#ff8700 +quote_3.fg=#af87ff +quote_4.fg=#ff5fd7 +quote_x.fg=#808080 diff --git a/stylesets/default b/stylesets/default index a8fb6299..02afe550 100644 --- a/stylesets/default +++ b/stylesets/default @@ -52,13 +52,23 @@ #completion_default.fg = 15 #[viewer] -#url.underline=true -#header.bold=true -#signature.dim=true -#diff_meta.bold=true -#diff_chunk.dim=true -#diff_add.fg=2 -#diff_del.fg=1 -#quote_*.fg=6 -#quote_*.dim=true -#quote_1.dim=false +#url.underline = true +#url.fg = 3 +#header.bold = true +#header.fg = 4 +#signature.dim = true +#signature.fg = 4 +#diff_meta.bold = true +#diff_chunk.fg = 6 +#diff_chunk_func.fg = 6 +#diff_chunk_func.dim = true +#diff_add.fg = 2 +#diff_del.fg = 1 +#quote_1.fg = 6 +#quote_2.fg = 4 +#quote_3.fg = 6 +#quote_3.dim = true +#quote_4.fg = 4 +#quote_4.dim = true +#quote_x.fg = 5 +#quote_x.dim = true diff --git a/stylesets/dracula b/stylesets/dracula index 73623547..f4eada3b 100644 --- a/stylesets/dracula +++ b/stylesets/dracula @@ -1,3 +1,8 @@ +# vim: ft=dosini +# +# aerc dracula styleset +# + *.default=true *.normal=true diff --git a/stylesets/pink b/stylesets/pink index deaae5ac..dfc53b71 100644 --- a/stylesets/pink +++ b/stylesets/pink @@ -56,18 +56,18 @@ default.selected.bg=#de4e85 completion_default.selected.bg=#de4e85 -#[viewer] -#url.fg=#ffffaf -#url.underline=true -#header.fg=#af87ff -#signature.fg=#af87ff -#diff_meta.fg=#ffffff -#diff_meta.bold=true -#diff_chunk.fg=#00cdcd -#diff_add.fg=#00cd00 -#diff_del.fg=#cd0000 -#quote_1.fg=#5fafff -#quote_2.fg=#ff8700 -#quote_3.fg=#af87ff -#quote_4.fg=#ff5fd7 -#quote_x.fg=#808080 +[viewer] +url.fg=#ffffaf +url.underline=true +header.fg=#af87ff +signature.fg=#af87ff +diff_meta.fg=#ffffff +diff_meta.bold=true +diff_chunk.fg=#00cdcd +diff_add.fg=#00cd00 +diff_del.fg=#cd0000 +quote_1.fg=#5fafff +quote_2.fg=#ff8700 +quote_3.fg=#af87ff +quote_4.fg=#ff5fd7 +quote_x.fg=#808080 |