From 5e1137c46050d6d1d10fb1cbf842d5efd455f926 Mon Sep 17 00:00:00 2001 From: Emilia Date: Fri, 29 Dec 2023 18:03:00 -0500 Subject: [PATCH] Fix: indexing error w.r.t. logarithm argument --- src/components/plates/util.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/plates/util.rs b/src/components/plates/util.rs index 845d1ae..51de79b 100644 --- a/src/components/plates/util.rs +++ b/src/components/plates/util.rs @@ -35,15 +35,15 @@ impl ColorPalette { self.get((2f64.powi(-(t.ilog2() as i32))) * (t as f64 + 0.5f64) - 1.0f64) } - pub fn get_uuid(&self, t: uuid::Uuid) -> [f64; 3] { - // self.get(t.as_u128() as f64 / (u128::MAX) as f64) - let mut r = SmallRng::seed_from_u64(t.as_u128() as u64); - self.get(r.gen_range(0.0..1.0f64)) - } + // pub fn get_uuid(&self, t: uuid::Uuid) -> [f64; 3] { + // // self.get(t.as_u128() as f64 / (u128::MAX) as f64) + // let mut r = SmallRng::seed_from_u64(t.as_u128() as u64); + // self.get(r.gen_range(0.0..1.0f64)) + // } pub fn get_ordered(&self, t: uuid::Uuid, ordered_uuids: &Vec) -> [f64; 3] { - let index = ordered_uuids.iter().position(|&x| x == t).expect("uuid must be in list of uuids"); + let index = ordered_uuids.iter().position(|&x| x == t).expect("uuid must be in list of uuids") + 1; return self.get(Self::space_evenly(index)) }