13 lines
		
	
	
	
		
			303 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
	
		
			303 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use super::Color;
 | |
| use std::io::Write;
 | |
| 
 | |
| 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();
 | |
| }
 |