use std::io;
use std::io::{Write};
use std::cmp::PartialOrd;
pub mod random;
pub mod math;
mod color;
pub use color::Color;
mod thread_pool;
pub use thread_pool::ThreadPool;
pub fn clamp<T: PartialOrd>(value: T, min: T, max: T) -> T {
if value < min {
min
} else if value > max {
max
} else {
value
}
}
pub fn input(msg: &str) -> io::Result<String> {
print!("{}", msg);
io::stdout().flush()?;
let mut buffer = String::new();
io::stdin().read_line(&mut buffer)?;
let buffer = buffer.trim().to_owned();
Ok(buffer)
}