Black text incorrectly drawn
Closed this issue · 1 comments
granolaonicecream commented
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, ...