rgba
This commit is contained in:
@ -16,8 +16,8 @@ fn generate_png(n: u32, m: u32, width: u32, height: u32) {
|
|||||||
let val = chladni(xf, yf, n as f64, m as f64);
|
let val = chladni(xf, yf, n as f64, m as f64);
|
||||||
let intensity = val.abs();
|
let intensity = val.abs();
|
||||||
|
|
||||||
let brigh = (((0.08 - intensity).max(0.0) / 0.08) * 255.0) as u8;
|
let bright = (((0.08 - intensity).max(0.0) / 0.08) * 255.0) as u8;
|
||||||
*pixel = Rgba([0, 0, 0, brigh]);
|
*pixel = Rgba([0, 0, 0, bright]);
|
||||||
// *pixel = Rgb([brigh, brigh, brigh]);
|
// *pixel = Rgb([brigh, brigh, brigh]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user