Implements 2 helper functions for Color type (white() and black())

and uses it in layout_task.rs.
This commit is contained in:
Adenilson Cavalcanti 2015-02-02 10:52:17 -08:00
parent 755adf0dde
commit 417ffca937
2 changed files with 17 additions and 4 deletions

View file

@ -21,3 +21,13 @@ pub fn rgb(r: u8, g: u8, b: u8) -> AzColor {
pub fn rgba(r: AzFloat, g: AzFloat, b: AzFloat, a: AzFloat) -> AzColor {
AzColor { r: r, g: g, b: b, a: a }
}
#[inline]
pub fn black() -> AzColor {
AzColor { r: 0.0, g: 0.0, b: 0.0, a: 0.0 }
}
#[inline]
pub fn white() -> AzColor {
AzColor { r: 1.0, g: 1.0, b: 1.0, a: 1.0 }
}