From f3e0638329689f7ccc8ebaff80a1d918ec9f68e1 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sun, 9 Feb 2020 03:21:15 -0500 Subject: [PATCH] Allow hue to be in degrees --- src/builtin/color.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/builtin/color.rs b/src/builtin/color.rs index cccc478..225f859 100644 --- a/src/builtin/color.rs +++ b/src/builtin/color.rs @@ -40,7 +40,8 @@ pub(crate) fn register(f: &mut BTreeMap) { decl!(f "hsl", |args, _| { let hue = match arg!(args, 0, "hue").clone().eval() { Value::Dimension(n, Unit::None) - | Value::Dimension(n, Unit::Percent) => n, + | Value::Dimension(n, Unit::Percent) + | Value::Dimension(n, Unit::Deg) => n, _ => todo!("expected either unitless or % number for alpha"), }; let saturation = match arg!(args, 1, "saturation").clone().eval() { @@ -58,7 +59,8 @@ pub(crate) fn register(f: &mut BTreeMap) { decl!(f "hsla", |args, _| { let hue = match arg!(args, 0, "hue").clone().eval() { Value::Dimension(n, Unit::None) - | Value::Dimension(n, Unit::Percent) => n, + | Value::Dimension(n, Unit::Percent) + | Value::Dimension(n, Unit::Deg) => n, _ => todo!("expected either unitless or % number for alpha"), }; let saturation = match arg!(args, 1, "saturation").clone().eval() {