| 134 | } |
| 135 | |
| 136 | fn thingy(&self) -> Line<'_> { |
| 137 | let mut line = Line::new( |
| 138 | "parametric", |
| 139 | PlotPoints::from_parametric_callback( |
| 140 | move |t| ((2.0 * t + self.time).sin(), (3. * t).sin()), |
| 141 | 0.0..=TAU, |
| 142 | 256, |
| 143 | ), |
| 144 | ) |
| 145 | .style(self.line_style); |
| 146 | if self.gradient { |
| 147 | line = line.gradient_color( |
| 148 | Arc::new(|p| egui::Color32::BLUE.lerp_to_gamma(egui::Color32::ORANGE, p.x.abs().clamp(0., 1.) as f32)), |
| 149 | self.gradient_fill, |
| 150 | ); |
| 151 | if self.gradient_fill { |
| 152 | line = line.fill(0.); |
| 153 | } |
| 154 | } else { |
| 155 | line = line.color(egui::Color32::from_rgb(100, 150, 250)); |
| 156 | } |
| 157 | line |
| 158 | } |
| 159 | |
| 160 | pub fn show_plot(&mut self, ui: &mut egui::Ui) -> Response { |
| 161 | if self.animate { |