Skip to content

Commit 1c69b99

Browse files
committed
Unswap some min and maxes.
1 parent 6a10862 commit 1c69b99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

color.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ fn parse_color_function(name: &str, arguments: &[ComponentValue])
297297
let hue = expect_number!() / 360.;
298298
let hue = hue - hue.floor();
299299
expect_comma!();
300-
let saturation = (expect_percentage!() / 100.).min(0.).max(1.);
300+
let saturation = (expect_percentage!() / 100.).max(0.).min(1.);
301301
expect_comma!();
302-
let lightness = (expect_percentage!() / 100.).min(0.).max(1.);
302+
let lightness = (expect_percentage!() / 100.).max(0.).min(1.);
303303

304304
// http://www.w3.org/TR/css3-color/#hsl-color
305305
fn hue_to_rgb(m1: f64, m2: f64, mut h: f64) -> f64 {
@@ -321,7 +321,7 @@ fn parse_color_function(name: &str, arguments: &[ComponentValue])
321321

322322
let alpha = if has_alpha {
323323
expect_comma!();
324-
(expect_number!()).min(0.).max(1.) as f32
324+
(expect_number!()).max(0.).min(1.) as f32
325325
} else {
326326
1.
327327
};

0 commit comments

Comments
 (0)