Renderer/src/color.rs

6 lines
245 B
Rust
Raw Normal View History

2022-04-20 18:58:58 +02:00
use std::io::Write;
use super::Color;
pub fn write_color(out: &mut impl Write, pixel_color: Color) {
write!(out, "{} {} {}\n", (255.999*pixel_color.x()) as u32, (255.999*pixel_color.y()) as u32, (255.999*pixel_color.z()) as u32).unwrap();
}