Skip to content

Commit e59e6d5

Browse files
committed
rename variable to more general name
1 parent 654752e commit e59e6d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plotters/src/style/colors/colormaps.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ pub fn calculate_relative_difference_index_lower_upper<
8585
h: FloatType,
8686
min: FloatType,
8787
max: FloatType,
88-
n_colors: usize,
88+
n_steps: usize,
8989
) -> (FloatType, usize, usize) {
9090
// Ensure that we do have a value in bounds
9191
let h = num_traits::clamp(h, min, max);
9292
// Next calculate a normalized value between 0.0 and 1.0
9393
let t = (h - min) / (max - min);
9494
let approximate_index =
95-
t * (FloatType::from_usize(n_colors).unwrap() - FloatType::one()).max(FloatType::zero());
95+
t * (FloatType::from_usize(n_steps).unwrap() - FloatType::one()).max(FloatType::zero());
9696
// Calculate which index are the two most nearest of the supplied value
9797
let index_lower = approximate_index.floor().to_usize().unwrap();
9898
let index_upper = approximate_index.ceil().to_usize().unwrap();

0 commit comments

Comments
 (0)