From 6ce60f2feafe57dbc115e388007de46449c4089c Mon Sep 17 00:00:00 2001 From: memdmp Date: Mon, 13 Jan 2025 12:10:19 +0100 Subject: feat: we have colour im really bored lol --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index ae1cdaf..9855cdc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,10 +85,10 @@ pub fn main() { for y in 0..h { let idx = (y * w + x) as usize * 4; - f[idx] = 255; - f[idx + 1] = 255; - f[idx + 2] = 255; - f[idx + 3] = if sin_y > y as usize { 255 } else { 0 }; + f[idx] = 122 - (x / 8) as u8; + f[idx + 1] = 255 - (x / 2) as u8; + f[idx + 2] = (x / 2) as u8; + f[idx + 3] = if sin_y < y as usize { 255 } else { 0 }; } } sin_offset += sin_speed; -- cgit v1.2.3