Implement button::DefaultStyle for Color

This commit is contained in:
Héctor Ramón Jiménez 2024-03-07 20:16:07 +01:00
parent 34ca5386b5
commit b8f05eb8dd
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -454,6 +454,12 @@ impl DefaultStyle for Appearance {
}
}
impl DefaultStyle for Color {
fn default_style() -> Style<Self> {
|color, _status| Appearance::with_background(*color)
}
}
/// A primary button; denoting a main action.
pub fn primary(theme: &Theme, status: Status) -> Appearance {
let palette = theme.extended_palette();