Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support white background terminals #156

Closed
goerz opened this issue Sep 7, 2022 · 4 comments
Closed

Support white background terminals #156

goerz opened this issue Sep 7, 2022 · 4 comments
Labels
good first issue Good for newcomers

Comments

@goerz
Copy link

goerz commented Sep 7, 2022

This library assumes that it is being used in a dark background terminal.

It would be great to be able to use it in white background terminal:

fa210621469e109f0b1b942c7248a782f4de7f59_2_290x500

  • There seem to be many hard-code color values, for example, the name of the scheme being printed in white in the above screenshot, from here:

    Term.jl/src/theme.jl

    Lines 94 to 105 in 4ab195d

    return print(
    io,
    Panel(
    content;
    width = 44,
    justify = :center,
    title = "Theme: {bold}$(theme.name){/bold}",
    padding = (4, 4, 1, 1),
    style = "#9bb3e0",
    title_style = "white",
    ),
    )

    Similarly, there are lots of hard-coded values in errors.jl and logs.jl, which unfortunately makes the otherwise very nice install_term_logger and install_term_stacktrace impossible to use. All of these colors should refer to something configurable in the color scheme

  • There should be a switch to turn off all color, for monochrome or reduced-color terminals. The framed backtraces and such would be quite nice to have, but they should be rendered black on white (or white on black) in such environments

  • It would be nice to have a built-in colorscheme that is tested for readability on white background terminals.

  • The cherry on top would be to detect the background color of the terminal (e.g. via the COLORFGBG environment variable) and to choose the default scheme based on that.

@FedeClaudi
Copy link
Owner

Hey,

Thanks for opening this issue, it's a very good point.
I completely agree, all the hardcoded color values should be offloaded to the theme to allow complete customization.
Further, there should be a few pre-defined themes for light/dark and readability, as you suggest.

It seems like a fairly easy fix, perfect for someone that wants to actively contribute to Term 😄
Would you be interested in working on a PR?

@goerz
Copy link
Author

goerz commented Sep 7, 2022

Interested, yes 😀. Available, probably not (or at least I shouldn't).

Maybe I won't be able to help myself, so let's see. But if someone else wants to jump in, it would save me from the procrastination hole. 😉

@FedeClaudi
Copy link
Owner

Hahah, it seems like we're on the same boat here!

Let's leave it open and see who gives in first 😉

@FedeClaudi
Copy link
Owner

Fixed by #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants