From f550d820b0e417b9e3d0dbe4c3e62b2a516e8ba5 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sun, 16 Feb 2020 22:49:19 -0500 Subject: [PATCH] change-color() hue error message --- src/builtin/color/other.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/builtin/color/other.rs b/src/builtin/color/other.rs index 0bc913b..e9bacd1 100644 --- a/src/builtin/color/other.rs +++ b/src/builtin/color/other.rs @@ -58,11 +58,9 @@ pub(crate) fn register(f: &mut BTreeMap) { } let hue = match arg!(args, -1, "hue"=Value::Null) { - Value::Dimension(n, Unit::None) - | Value::Dimension(n, Unit::Percent) - | Value::Dimension(n, Unit::Deg) => Some(n), + Value::Dimension(n, _) => Some(n), Value::Null => None, - _ => todo!("expected either unitless or % number for hue"), + v => return Err(format!("$hue: {} is not a number.", v).into()), }; opt_arg!(args, saturation, "saturation", 0, 100);