Realize the triangle struct doesn't work and completely refactor it

This commit is contained in:
bijan2005 2020-12-05 23:22:19 -05:00
parent 822941d561
commit cddec468de
6 changed files with 107 additions and 71 deletions

View file

@ -48,22 +48,8 @@ impl Color {
[red, green, blue]
}
pub fn black() -> Self {
Color {
red: 0.0,
green: 0.0,
blue: 0.0,
pub fn gray(brightness: f32) -> Self { Color::new(brightness, brightness, brightness) }
_private: ()
}
}
pub fn white() -> Self {
Color {
red: 1.0,
green: 1.0,
blue: 1.0,
_private: ()
}
}
pub fn black() -> Self { Color::gray(0.0) }
pub fn white() -> Self { Color::gray(1.0) }
}