Skip to content

Commit 958c2bb

Browse files
committed
Revert changing .min.max to .clamp
This library needs to compile with rustc 1.40 for some reason and .clamp was added in 1.50, so reverting for now.
1 parent a929319 commit 958c2bb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/color.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,8 @@ where
853853
component_parser
854854
.parse_number_or_percentage(arguments)?
855855
.unit_value()
856-
.clamp(0.0, OPAQUE)
856+
.max(0.)
857+
.min(OPAQUE)
857858
} else {
858859
OPAQUE
859860
})
@@ -936,15 +937,17 @@ where
936937

937938
let first_percentage = component_parser
938939
.parse_percentage(arguments)?
939-
.clamp(0.0, 1.0);
940+
.max(0.)
941+
.min(1.0);
940942

941943
if uses_commas {
942944
arguments.expect_comma()?;
943945
}
944946

945947
let second_percentage = component_parser
946948
.parse_percentage(arguments)?
947-
.clamp(0.0, 1.0);
949+
.max(0.)
950+
.min(1.0);
948951

949952
let (red, green, blue) = to_rgb(hue, first_percentage, second_percentage);
950953
let red = clamp_unit_f32(red);

0 commit comments

Comments
 (0)