This commit is contained in:
jane 2021-12-29 23:02:14 -05:00
parent 5c4803526a
commit 7dacd45610
2 changed files with 7 additions and 4 deletions

View file

@ -139,15 +139,15 @@ impl Pattern for Random {
let max = self.max;
if self.r {
let y: f64 = rng.gen();
color[2] = ((y * (max - min) as f64) as u8 + min);
color[2] = (y * (max - min) as f64) as u8 + min;
}
if self.g {
let y: f64 = rng.gen();
color[1] = ((y * (max - min) as f64) as u8 + min);
color[1] = (y * (max - min) as f64) as u8 + min;
}
if self.b {
let y: f64 = rng.gen();
color[0] = ((y * (max - min) as f64) as u8 + min);
color[0] = (y * (max - min) as f64) as u8 + min;
}
}
}

View file

@ -31,7 +31,10 @@ pub fn websocket(pattern: &Arc<Mutex<Vec<Box<dyn Pattern>>>>) {
}
else {
let msg = tungstenite::Message::from("Not text");
websocket.write_message(msg);
match websocket.write_message(msg) {
// fuck this result in particular
_ => {}
};
}
}
});