Skip to content

Commit

Permalink
fix loop condition
Browse files Browse the repository at this point in the history
  • Loading branch information
apparebit committed Jun 7, 2024
1 parent 6cd3f06 commit 85167be
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/color/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,7 @@ pub fn map_to_gamut(target: ColorSpace, coordinates: &[f64; 3]) -> [f64; 3] {
let mut max = origin_as_oklch[1];
let mut min_in_gamut = true;

loop {
if max - min <= EPSILON {
break;
}

while max - min > EPSILON {
let chroma = (min + max) / 2.0;
current_as_oklch = [current_as_oklch[0], chroma, current_as_oklch[2]];

Expand Down

0 comments on commit 85167be

Please sign in to comment.