hsl/hsla 4 args special functions
This commit is contained in:
parent
6b817dcb24
commit
0ddabb5afd
@ -117,6 +117,12 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
|
|||||||
format!("$alpha: Expected {} to have no units or \"%\".", v).into()
|
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()),
|
v => return Err(format!("$alpha: {} is not a number.", v).into()),
|
||||||
};
|
};
|
||||||
Ok(Value::Color(Color::from_hsla(
|
Ok(Value::Color(Color::from_hsla(
|
||||||
@ -233,6 +239,12 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
|
|||||||
format!("$alpha: Expected {} to have no units or \"%\".", v).into()
|
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()),
|
v => return Err(format!("$alpha: {} is not a number.", v).into()),
|
||||||
};
|
};
|
||||||
Ok(Value::Color(Color::from_hsla(
|
Ok(Value::Color(Color::from_hsla(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user