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 (currently always #AAAAAA gray) #153

Open
lkraav opened this issue Dec 28, 2021 · 5 comments
Open

Support white background (currently always #AAAAAA gray) #153

lkraav opened this issue Dec 28, 2021 · 5 comments
Labels
enhancement This issue/PR relates to a feature request.

Comments

@lkraav
Copy link

lkraav commented Dec 28, 2021

Hi. Browsing through style.py seems to indicate there's currently no way to override #AAAAAA with plain old #FFFFFF. Am I missing something, or is this a feature request?

@hartwork
Copy link
Collaborator

hartwork commented Feb 2, 2022

Hi @lkraav ,

when ansi2html started at 0a732b1 it was white…

Dark mode Light mode CSS class
Foreground #AAAAAA #000000 .f9
Background #000000 #FFFFFF .b9

…but at e24757d it became gray:

Dark mode Light mode CSS class
Foreground #AAAAAA #000000 .f9
Background #000000 #AAAAAA 👈 .b9

I believe ansi2html probably needs one new option for the foreground/text color and another one for the background, just like as terminals seem to have. I see it in both Terminator and Yakuake. We'll need to find a good way to integrate that with the existing --light-background, so that the UX still make sense:

# ansi2html --help | fgrep light
  -l, --light-background
                        Set output to 'light background' mode.

@hartwork hartwork changed the title 1.6.0: plain white background? Support white background (currently always #AAAAAA gray) Feb 2, 2022
@lkraav
Copy link
Author

lkraav commented Feb 3, 2022

Thanks for the find. I had to switch back to https://github.com/pixelb/scripts/blob/master/scripts/ansi2html.sh for time being, because that grey background just isn't good for readability (for my eyes, at least).

@hartwork
Copy link
Collaborator

hartwork commented Feb 3, 2022

It's a bit of a pity that these two tools are developing in parallel since 2010 I guess. Without checking I would have assumed the former source is dead. Sigh. I have no intentions of blaming your eyes, a custom color including white should absolutely be possible.

@Juice805
Copy link

Or, more generally, allow for any passed in background color or even none.

@nevdelap
Copy link

nevdelap commented Jul 26, 2023

Here is a workaround:

    content = ansi2html.Ansi2HTMLConverter(inline=True).convert(content) 
    content = content.replace("color: #000000;", "color: #ffffff;" )
    content = content.replace("color: #AAAAAA;", "color: #000000;" )

@ssbarnea ssbarnea added enhancement This issue/PR relates to a feature request. and removed feature labels Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue/PR relates to a feature request.
Projects
None yet
Development

No branches or pull requests

5 participants