Skip to content

Commit

Permalink
Cargo update colcon to fix rounding
Browse files Browse the repository at this point in the history
I'm ashamed it took me this long to realize why my generated hexes
always seemed slightly off...
  • Loading branch information
Beinsezii committed Jun 28, 2024
1 parent 1e84e63 commit 149826c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ pub fn apply_space(space: Space, colors: &mut [[f32; 3]], to: colcon::Space, hig
.for_each(|p| *p = [p[2] / 360.0, p[1] / 100.0, p[0] / 100.0]);
} else {
colors.iter_mut().for_each(|p| {
// 99.9 to compensate downward precision loss
// to reach white on complex spaces like jzazbz
p[0] = p[0] / 99.9 * space.srgb_quants()[100][0];
p[0] = p[0] / 100.0 * space.srgb_quants()[100][0];
p[1] = p[1] / 100.0 * space.srgb_quants()[95][1];
});
if high2023 != 0.0 {
Expand Down

0 comments on commit 149826c

Please sign in to comment.