@@ -81,19 +81,19 @@ macro_rules! calculate_new_color_value(
81
81
} ;
82
82
) ;
83
83
84
- /// Helper function to calculate the lower and upper index nearest to a provided float value.
85
- ///
86
- /// Used to obtain colors from a colorscale given a value h between 0.0 and 1.0.
87
- /// It also returns the relative difference which can then be used to calculate a linear interpolation between the two nearest colors.
88
- /// ```
89
- /// # use plotters::prelude::*;
90
- /// let r = calculate_relative_difference_index_lower_upper(1.2, 1.0, 3.0, 4);
91
- /// let (relative_difference, lower_index, upper_index) = r;
92
- ///
93
- /// assert_eq!(relative_difference, 0.7000000000000001);
94
- /// assert_eq!(lower_index, 0);
95
- /// assert_eq!(upper_index, 1);
96
- /// ```
84
+ // Helper function to calculate the lower and upper index nearest to a provided float value.
85
+ //
86
+ // Used to obtain colors from a colorscale given a value h between 0.0 and 1.0.
87
+ // It also returns the relative difference which can then be used to calculate a linear interpolation between the two nearest colors.
88
+ // ```
89
+ // # use plotters::prelude::*;
90
+ // let r = calculate_relative_difference_index_lower_upper(1.2, 1.0, 3.0, 4);
91
+ // let (relative_difference, lower_index, upper_index) = r;
92
+ //
93
+ // assert_eq!(relative_difference, 0.7000000000000001);
94
+ // assert_eq!(lower_index, 0);
95
+ // assert_eq!(upper_index, 1);
96
+ // ```
97
97
#[ doc( hidden) ]
98
98
pub fn calculate_relative_difference_index_lower_upper <
99
99
FloatType : num_traits:: Float + num_traits:: FromPrimitive + num_traits:: ToPrimitive ,
@@ -148,25 +148,22 @@ macro_rules! implement_color_scale_for_derived_color_map{
148
148
149
149
implement_color_scale_for_derived_color_map ! { RGBAColor , RGBColor , HSLColor }
150
150
151
- #[ doc( inline) ]
152
- pub use crate :: count;
153
-
154
151
#[ macro_export]
155
152
#[ doc( hidden) ]
156
- /// Counts the number of arguments which are separated by spaces
157
- ///
158
- /// This macro is used internally to determine the size of an array to hold all new colors.
159
- /// ```
160
- /// # use plotters::count;
161
- /// let counted = count!{Plotting is fun};
162
- /// assert_eq!(counted, 3);
163
- ///
164
- /// let counted2 = count!{0_usize was my favourite 1_f64 last century};
165
- /// assert_eq!(counted2, 7);
166
- ///
167
- /// let new_array = ["Hello"; count!(Plotting is fun)];
168
- /// assert_eq!(new_array, ["Hello"; 3]);
169
- /// ```
153
+ // Counts the number of arguments which are separated by spaces
154
+ //
155
+ // This macro is used internally to determine the size of an array to hold all new colors.
156
+ // ```
157
+ // # use plotters::count;
158
+ // let counted = count!{Plotting is fun};
159
+ // assert_eq!(counted, 3);
160
+ //
161
+ // let counted2 = count!{0_usize was my favourite 1_f64 last century};
162
+ // assert_eq!(counted2, 7);
163
+ //
164
+ // let new_array = ["Hello"; count!(Plotting is fun)];
165
+ // assert_eq!(new_array, ["Hello"; 3]);
166
+ // ```
170
167
macro_rules! count {
171
168
( ) => ( 0usize ) ;
172
169
( $x: tt $( $xs: tt) * ) => ( 1usize + $crate:: count!( $( $xs) * ) ) ;
0 commit comments