From e1db06475c7d1833b7a4469b797cdadceb28df6e Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 3 Feb 2015 17:40:50 -0800 Subject: [PATCH] There are cases where we need opaque black (e.g. border color) and other cases where we need transparent black (e.g. clearing, root layers). --- components/gfx/color.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/gfx/color.rs b/components/gfx/color.rs index f1f589ef4b7..0bf03bff6dc 100644 --- a/components/gfx/color.rs +++ b/components/gfx/color.rs @@ -24,6 +24,11 @@ pub fn rgba(r: AzFloat, g: AzFloat, b: AzFloat, a: AzFloat) -> AzColor { #[inline] pub fn black() -> AzColor { + AzColor { r: 0.0, g: 0.0, b: 0.0, a: 1.0 } +} + +#[inline] +pub fn transparent_black() -> AzColor { AzColor { r: 0.0, g: 0.0, b: 0.0, a: 0.0 } }