Add basic color to spheres
This commit is contained in:
parent
9d188ed692
commit
cb87c1e70c
107 changed files with 77 additions and 28 deletions
19
src/types.rs
19
src/types.rs
|
|
@ -47,4 +47,23 @@ impl Color {
|
|||
let blue = (255.0 * self.blue) as u8;
|
||||
[red, green, blue]
|
||||
}
|
||||
|
||||
pub fn black() -> Self {
|
||||
Color {
|
||||
red: 0.0,
|
||||
green: 0.0,
|
||||
blue: 0.0,
|
||||
|
||||
_private: ()
|
||||
}
|
||||
}
|
||||
pub fn white() -> Self {
|
||||
Color {
|
||||
red: 1.0,
|
||||
green: 1.0,
|
||||
blue: 1.0,
|
||||
|
||||
_private: ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue