@@ -23,7 +23,7 @@ pub fn mix(
23
23
. as_f64 ( )
24
24
. ok_or_else ( || tera:: Error :: msg ( "blend amount must be a number" ) ) ?;
25
25
26
- let result = Color :: mix ( & base, & blend, amount) ;
26
+ let result = Color :: mix ( & base, & blend, amount) ? ;
27
27
28
28
Ok ( tera:: to_value ( result) ?)
29
29
}
@@ -35,16 +35,16 @@ pub fn modify(
35
35
let color: Color = tera:: from_value ( value. clone ( ) ) ?;
36
36
if let Some ( hue) = args. get ( "hue" ) {
37
37
let hue = tera:: from_value ( hue. clone ( ) ) ?;
38
- Ok ( tera:: to_value ( color. mod_hue ( hue) ) ?)
38
+ Ok ( tera:: to_value ( color. mod_hue ( hue) ? ) ?)
39
39
} else if let Some ( saturation) = args. get ( "saturation" ) {
40
40
let saturation = tera:: from_value ( saturation. clone ( ) ) ?;
41
- Ok ( tera:: to_value ( color. mod_saturation ( saturation) ) ?)
41
+ Ok ( tera:: to_value ( color. mod_saturation ( saturation) ? ) ?)
42
42
} else if let Some ( lightness) = args. get ( "lightness" ) {
43
43
let lightness = tera:: from_value ( lightness. clone ( ) ) ?;
44
- Ok ( tera:: to_value ( color. mod_lightness ( lightness) ) ?)
44
+ Ok ( tera:: to_value ( color. mod_lightness ( lightness) ? ) ?)
45
45
} else if let Some ( opacity) = args. get ( "opacity" ) {
46
46
let opacity = tera:: from_value ( opacity. clone ( ) ) ?;
47
- Ok ( tera:: to_value ( color. mod_opacity ( opacity) ) ?)
47
+ Ok ( tera:: to_value ( color. mod_opacity ( opacity) ? ) ?)
48
48
} else {
49
49
Ok ( value. clone ( ) )
50
50
}
@@ -57,16 +57,16 @@ pub fn add(
57
57
let color: Color = tera:: from_value ( value. clone ( ) ) ?;
58
58
if let Some ( hue) = args. get ( "hue" ) {
59
59
let hue = tera:: from_value ( hue. clone ( ) ) ?;
60
- Ok ( tera:: to_value ( color. add_hue ( hue) ) ?)
60
+ Ok ( tera:: to_value ( color. add_hue ( hue) ? ) ?)
61
61
} else if let Some ( saturation) = args. get ( "saturation" ) {
62
62
let saturation = tera:: from_value ( saturation. clone ( ) ) ?;
63
- Ok ( tera:: to_value ( color. add_saturation ( saturation) ) ?)
63
+ Ok ( tera:: to_value ( color. add_saturation ( saturation) ? ) ?)
64
64
} else if let Some ( lightness) = args. get ( "lightness" ) {
65
65
let lightness = tera:: from_value ( lightness. clone ( ) ) ?;
66
- Ok ( tera:: to_value ( color. add_lightness ( lightness) ) ?)
66
+ Ok ( tera:: to_value ( color. add_lightness ( lightness) ? ) ?)
67
67
} else if let Some ( opacity) = args. get ( "opacity" ) {
68
68
let opacity = tera:: from_value ( opacity. clone ( ) ) ?;
69
- Ok ( tera:: to_value ( color. add_opacity ( opacity) ) ?)
69
+ Ok ( tera:: to_value ( color. add_opacity ( opacity) ? ) ?)
70
70
} else {
71
71
Ok ( value. clone ( ) )
72
72
}
@@ -79,16 +79,16 @@ pub fn sub(
79
79
let color: Color = tera:: from_value ( value. clone ( ) ) ?;
80
80
if let Some ( hue) = args. get ( "hue" ) {
81
81
let hue = tera:: from_value ( hue. clone ( ) ) ?;
82
- Ok ( tera:: to_value ( color. sub_hue ( hue) ) ?)
82
+ Ok ( tera:: to_value ( color. sub_hue ( hue) ? ) ?)
83
83
} else if let Some ( saturation) = args. get ( "saturation" ) {
84
84
let saturation = tera:: from_value ( saturation. clone ( ) ) ?;
85
- Ok ( tera:: to_value ( color. sub_saturation ( saturation) ) ?)
85
+ Ok ( tera:: to_value ( color. sub_saturation ( saturation) ? ) ?)
86
86
} else if let Some ( lightness) = args. get ( "lightness" ) {
87
87
let lightness = tera:: from_value ( lightness. clone ( ) ) ?;
88
- Ok ( tera:: to_value ( color. sub_lightness ( lightness) ) ?)
88
+ Ok ( tera:: to_value ( color. sub_lightness ( lightness) ? ) ?)
89
89
} else if let Some ( opacity) = args. get ( "opacity" ) {
90
90
let opacity = tera:: from_value ( opacity. clone ( ) ) ?;
91
- Ok ( tera:: to_value ( color. sub_opacity ( opacity) ) ?)
91
+ Ok ( tera:: to_value ( color. sub_opacity ( opacity) ? ) ?)
92
92
} else {
93
93
Ok ( value. clone ( ) )
94
94
}
0 commit comments