diff --git a/src/builtin/color/hsl.rs b/src/builtin/color/hsl.rs index c6dabad..e5be15f 100644 --- a/src/builtin/color/hsl.rs +++ b/src/builtin/color/hsl.rs @@ -117,6 +117,12 @@ pub(crate) fn register(f: &mut HashMap) { format!("$alpha: Expected {} to have no units or \"%\".", v).into() ) } + v if v.is_special_function() => { + return Ok(Value::Ident( + format!("hsl({}, {}, {}, {})", hue, saturation, lightness, v), + QuoteKind::None, + )); + } v => return Err(format!("$alpha: {} is not a number.", v).into()), }; Ok(Value::Color(Color::from_hsla( @@ -233,6 +239,12 @@ pub(crate) fn register(f: &mut HashMap) { format!("$alpha: Expected {} to have no units or \"%\".", v).into() ) } + v if v.is_special_function() => { + return Ok(Value::Ident( + format!("hsl({}, {}, {}, {})", hue, saturation, lightness, v), + QuoteKind::None, + )); + } v => return Err(format!("$alpha: {} is not a number.", v).into()), }; Ok(Value::Color(Color::from_hsla(