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

Black text incorrectly drawn #130

Closed
granolaonicecream opened this issue Sep 6, 2024 · 1 comment
Closed

Black text incorrectly drawn #130

granolaonicecream opened this issue Sep 6, 2024 · 1 comment

Comments

@granolaonicecream
Copy link

Issue

When using black text, all pixels are being drawn as white, making it appear as if the text is not being drawn at all if against a white background. This is very apparent in the demo, as it is mostly text.

Cause

Regression from #123

The new function to determine pixel color becomes constant when the coverage parameter is zeroed out by the rgb component value. That said, it looks like the calculation of c1,c2,c3 is also redundant so this formula could be cleaned up.

Relevant code:

let components = col.to_rgb8();
let c1 = f32::from(255 - components[0]);
...
color::RGB(
    (255.0 + (c1 - 255.0) * v) as u8, ...
@fenollp
Copy link
Collaborator

fenollp commented Sep 12, 2024

Fixed in #131

@fenollp fenollp closed this as completed Sep 12, 2024
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

No branches or pull requests

2 participants