diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/methods.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/model/methods.rs b/src/model/methods.rs index c5c12ed2..fc33bea9 100644 --- a/src/model/methods.rs +++ b/src/model/methods.rs @@ -17,6 +17,13 @@ pub fn call( let missing = || Err(missing_method(name, method)).at(span); let output = match value { + Value::Color(color) => match method { + "lighten" => Value::Color(color.lighten(args.expect("amount")?)), + "darken" => Value::Color(color.darken(args.expect("amount")?)), + "negate" => Value::Color(color.negate()), + _ => return missing(), + }, + Value::Str(string) => match method { "len" => Value::Int(string.len() as i64), "slice" => { @@ -108,13 +115,6 @@ pub fn call( _ => return missing(), }, - Value::Color(color) => match method { - "lighten" => Value::Color(color.lighten(args.expect("amount")?)), - "darken" => Value::Color(color.darken(args.expect("amount")?)), - "negate" => Value::Color(color.negate()), - _ => return missing(), - }, - _ => return missing(), }; |
