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

ncplane_hline() does not work with palindex channels #2813

Open
tstack opened this issue Dec 9, 2024 · 0 comments
Open

ncplane_hline() does not work with palindex channels #2813

tstack opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tstack
Copy link

tstack commented Dec 9, 2024

The ncplane_hline() code assumes the channels contain RGB values:

notcurses/src/lib/notcurses.c

Lines 2166 to 2175 in 3a3c75e

unsigned ur, ug, ub;
int r1, g1, b1, r2, g2, b2;
int br1, bg1, bb1, br2, bg2, bb2;
ncchannels_fg_rgb8(c1, &ur, &ug, &ub);
r1 = ur; g1 = ug; b1 = ub;
ncchannels_fg_rgb8(c2, &ur, &ug, &ub);
r2 = ur; g2 = ug; b2 = ub;
ncchannels_bg_rgb8(c1, &ur, &ug, &ub);
br1 = ur; bg1 = ug; bb1 = ub;
ncchannels_bg_rgb8(c2, &ur, &ug, &ub);

So, you get garbage when trying to draw a line with palette indexed colors.

Please include the following data:

  • notcurses version (available from notcurses-demo i)

v3.0.11

@tstack tstack added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant