1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::ui::{TextDirection, Shader, Rect};
use crate::{prelude::Color, ui::TileMode};
use crate::material::AlignmentGeometry;
use super::{Gradient, GradientTransform};
pub struct LinearGradient {
pub begin: Box<dyn AlignmentGeometry>,
pub colors: Vec<Color>,
pub end: Box<dyn AlignmentGeometry>,
pub stops: Vec<f32>,
pub tile_mode: TileMode,
pub transform: Box<dyn GradientTransform>,
}
impl Gradient for LinearGradient {
fn create_shader(&self, rect: Rect, text_direction: Option<TextDirection>) -> Shader {
todo!()
}
fn lerp_from(&self, a: Box<dyn Gradient>, t: f32) -> Box<dyn Gradient> {
todo!()
}
fn lerp_to(&self, b: Box<dyn Gradient>, t: f32) -> Box<dyn Gradient> {
todo!()
}
fn scale(&self, factor: f32) -> Box<dyn Gradient> {
todo!()
}
}