summaryrefslogblamecommitdiffstats
path: root/style/src/svg.rs
blob: 9378c1a728dcd6bc081cf3c54602a710bb7f60a3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10



                                   
                             

                                      
                                       

                                            


                                        




                                                  
                        

                                               
                                                            
 
//! Change the appearance of a svg.

use iced_core::Color;

/// The appearance of an SVG.
#[derive(Debug, Default, Clone, Copy)]
pub struct Appearance {
    /// The [`Color`] filter of an SVG.
    ///
    /// Useful for coloring a symbolic icon.
    ///
    /// `None` keeps the original color.
    pub color: Option<Color>,
}

/// The stylesheet of a svg.
pub trait StyleSheet {
    /// The supported style of the [`StyleSheet`].
    type Style: Default;

    /// Produces the [`Appearance`] of the svg.
    fn appearance(&self, style: &Self::Style) -> Appearance;
}