tessera-components 0.0.0

Basic components for tessera-ui, using md3e design principles.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use tessera_ui::{Color, DrawCommand};

/// Draw command for the simple rectangle pipeline.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct SimpleRectCommand {
    /// Fill color for the rectangle.
    pub color: Color,
}

impl DrawCommand for SimpleRectCommand {
    fn apply_opacity(&mut self, opacity: f32) {
        self.color = self
            .color
            .with_alpha(self.color.a * opacity.clamp(0.0, 1.0));
    }
}