iced_m3/style/mod.rs
1mod button;
2mod scrollable;
3mod shadow;
4
5pub use button::*;
6pub use scrollable::*;
7pub use shadow::*;
8
9use iced::Color;
10
11/// Returns the arithmetic average of the two input colors.
12pub fn mix_colors(a: Color, b: Color, t: f32) -> Color {
13 let t = t.clamp(0.0, 1.0);
14 Color {
15 r: a.r * t + b.r * (1.0 - t),
16 g: a.g * t + b.g * (1.0 - t),
17 b: a.b * t + b.b * (1.0 - t),
18 a: a.a * t + b.a * (1.0 - t),
19 }
20}