Type | Purpose |
|---|---|
Color | RGBA color with constants and helpers. |
Fill | Solid, linear-gradient, or radial-gradient fill. |
Stroke | Border or line paint with width, cap, join, and dash data. |
BoxShadow | Outer or inset shadow with offset, blur, spread, and color. |
BackdropFilter | Filter applied to already-painted content behind a widget. |
Container::new(Text::new("Status"))
.bg_fill(Fill::LinearGradient {
start: (0.0, 0.0),
end: (1.0, 1.0),
stops: vec![
(0.0, Color { r: 14, g: 165, b: 233, a: 255 }),
(1.0, Color { r: 34, g: 197, b: 94, a: 255 }),
],
})
.shadows(vec![BoxShadow {
offset: (0.0, 16.0),
blur_radius: 36.0,
spread_radius: -10.0,
color: Color { r: 15, g: 23, b: 42, a: 80 },
inset: false,
}])
.into()