Realize the triangle struct doesn't work and completely refactor it
This commit is contained in:
parent
822941d561
commit
cddec468de
6 changed files with 107 additions and 71 deletions
20
src/types.rs
20
src/types.rs
|
|
@ -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) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue