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

ncurses: handle white backgrounds, too #119

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

wsakernel
Copy link
Contributor

White backgrounds broke with the support of transparency because only the default bg color was considered. The fg color was still hardocded to white, resulting in white on white e.g. for the config screen. So, the default fg color needs also to be considered. Luckily, color pair 0 is set to the default colors after use_default_colors(), so we simply need to map the index for the standard color accordingly. This will also work when transparency is disabled because ncurses initializes color pair 0 to white on black when not calling use_default_colors() which is exactly what we want in this case.

White backgrounds broke with the support of transparency because only
the default bg color was considered. The fg color was still hardocded
to white, resulting in white on white e.g. for the config screen. So,
the default fg color needs also to be considered. Luckily, color pair 0
is set to the default colors after use_default_colors(), so we simply
need to map the index for the standard color accordingly. This will also
work when transparency is disabled because ncurses initializes color
pair 0 to white on black when not calling use_default_colors() which is
exactly what we want in this case.
@grrtrr grrtrr merged commit f4d4e50 into uoaerg:master Oct 9, 2023
@grrtrr
Copy link
Contributor

grrtrr commented Oct 9, 2023

Great find. Thank you for the PR.

@wsakernel wsakernel deleted the fix_white_bg branch October 31, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants