blob: a2c5708fb930c60ef413c911ffe2ecdec3b6b68c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#[derive(Debug, Clone)]
pub struct Buffer {
pub width: f32,
pub height: f32,
pub palette: Vec<char>,
}
impl Buffer {
pub fn from_height(height: f32, aspect_ratio: f32) -> Self {
Self {
height,
width: height * aspect_ratio,
palette: "$@B%8&WM#oahkbdpqwmZO0QLCJUYXzcvunxrjft/\\|()1{}[]?-_+~<>i!lI;:,\"^`'. ".chars().collect(),
}
}
}
|