diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-26 16:59:20 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-26 17:13:31 +0100 |
| commit | 0579fd4409375aaa9fd8e87a06fd59097b5fcd97 (patch) | |
| tree | 0ccf1d6218806b11d83998d568ae1fb0570c67b7 /src/model | |
| parent | 9db6e533cd8a1d925a7daad92e1b99e6f98ac773 (diff) | |
Reorganize library base
Diffstat (limited to 'src/model')
| -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(), }; |
