We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c88493 commit 8ea42d7Copy full SHA for 8ea42d7
src/pal.rs
@@ -126,9 +126,9 @@ impl f_pixel {
126
127
// 256, because numbers are in range 1..255.9999… rounded down
128
RGBA {
129
- r: (r.powf(gamma) * 256.) as u8,
130
- g: (g.powf(gamma) * 256.) as u8,
131
- b: (b.powf(gamma) * 256.) as u8,
+ r: (r.max(0.).powf(gamma) * 256.) as u8,
+ g: (g.max(0.).powf(gamma) * 256.) as u8,
+ b: (b.max(0.).powf(gamma) * 256.) as u8,
132
a: (self.a * (256. / f64::from(LIQ_WEIGHT_A)) as f32) as u8,
133
}
134
0 commit comments