zest_theme/container.rs
1//! [`Container`]: colors for a non-interactive region.
2
3use embedded_graphics::pixelcolor::PixelColor;
4
5/// Colors for a non-interactive UI region (background panel, primary
6/// content area, secondary panel, etc.).
7///
8/// Used by [`Theme::background`](crate::Theme::background),
9/// [`Theme::primary`](crate::Theme::primary), and
10/// [`Theme::secondary`](crate::Theme::secondary).
11#[derive(Copy, Clone, Debug, PartialEq)]
12pub struct Container<C: PixelColor> {
13 /// Fill color of the region.
14 pub base: C,
15 /// Color of text and icons drawn on top of `base`.
16 pub on_base: C,
17 /// Color of subtle dividers within the region.
18 pub divider: C,
19}
20
21impl<C: PixelColor> Container<C> {
22 /// Construct a container with the given base, on-base, and divider colors.
23 #[must_use]
24 pub const fn new(base: C, on_base: C, divider: C) -> Self {
25 Self {
26 base,
27 on_base,
28 divider,
29 }
30 }
31}