Allow hue to be in degrees
This commit is contained in:
parent
5cab99cd6e
commit
f3e0638329
@ -40,7 +40,8 @@ pub(crate) fn register(f: &mut BTreeMap<String, Builtin>) {
|
||||
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<String, Builtin>) {
|
||||
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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user