File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
plotters/src/style/colors Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ impl<ColorType: crate::style::Color + Clone> DerivedColorMap<ColorType> {
41
41
/// This function lets the user define a new colormap by simply specifying colors in the correct order.
42
42
/// For calculation of the color values, the colors will be spaced evenly apart.
43
43
pub fn new ( colors : & [ ColorType ] ) -> Self {
44
- DerivedColorMap { colors : colors. iter ( ) . cloned ( ) . collect ( ) }
44
+ DerivedColorMap {
45
+ colors : colors. to_vec ( ) ,
46
+ }
45
47
}
46
48
}
47
49
@@ -98,7 +100,7 @@ fn calculate_relative_difference_index_lower_upper<
98
100
let index_upper = approximate_index. ceil ( ) . to_usize ( ) . unwrap ( ) ;
99
101
// Calculate the relative difference, ie. is the actual value more towards the color of index_upper or index_lower?
100
102
let relative_difference = approximate_index. ceil ( ) - approximate_index;
101
- return ( relative_difference, index_lower, index_upper) ;
103
+ ( relative_difference, index_lower, index_upper)
102
104
}
103
105
104
106
macro_rules! implement_color_scale_for_derived_color_map{
You can’t perform that action at this time.
0 commit comments