material-ui-rs 0.5.2

A Material3 inspired theme for `iced`
Documentation
use iced_widget::qr_code::{Catalog, Style, StyleFn};

use crate::Theme;

impl Catalog for Theme {
    type Class<'a> = StyleFn<'a, Self>;

    fn default<'a>() -> Self::Class<'a> {
        Box::new(default)
    }

    fn style(&self, class: &Self::Class<'_>) -> Style {
        class(self)
    }
}

pub fn default(theme: &Theme) -> Style {
    let surface = theme.colors().surface;

    Style {
        cell: surface.text,
        background: surface.color,
    }
}