pub fn to_theme(resolved: &ResolvedThemeVariant, name: &str) -> ThemeExpand description
Create an iced iced_core::theme::Theme from a native_theme::ResolvedThemeVariant.
Builds a custom theme using Theme::custom_with_fn(), which:
- Maps the 6 Palette fields from resolved theme colors via
palette::to_palette() - Generates an Extended palette, then overrides secondary, background.weak,
and status-family
.base.textentries viaextended::apply_overrides()
The resulting theme carries the mapped Palette and Extended palette. iced’s built-in Catalog trait implementations for all 8 core widgets (Button, Container, TextInput, Scrollable, Checkbox, Slider, ProgressBar, Tooltip) automatically derive their Style structs from this palette. No explicit Catalog implementations are needed.
The name sets the theme’s display name (visible in theme pickers).
For the common case, use from_preset() to derive the name automatically.
Note: iced has no info color family in its Extended palette, so
info / info_foreground are not mapped automatically. Use
info_color() and info_foreground_color() helpers to access them.