pub fn new<S: ToString>(name: S, colors: Vec<Color>) -> Result<Self, NewPaletteError> {
        match colors.len() {
            0 => Err(NewPaletteError::NoColors),
            _ => {
                Ok(Palette {
                       _name: name.to_string(),
                       _colors: colors,
                   })
            }
        }
    }
/// Creates a new named Palette from a non-zero-length collection of Colors.
///
/// Passing a zero-length collection will result in an Err(NewPaletteError::NoColors)
Creates a new named Palette from a non-zero-length collection of Colors.
Passing a zero-length collection will result in an Err(NewPaletteError::NoColors)
Creates a new named Palette from a non - zero - length collection of Colors . Passing a zero - length collection will result in an Err ( NewPaletteError :: NoColors )
pub fn new<S: ToString>(name: S, colors: Vec<Color>) -> Result<Self, NewPaletteError> {
        match colors.len() {
            0 => Err(NewPaletteError::NoColors),
            _ => {
                Ok(Palette {
                       _name: name.to_string(),
                       _colors: colors,
                   })
            }
        }
    }
pub fn new < S : ToString > ( name : S , colors : Vec < Color > ) -> Result < Self , NewPaletteError > { match colors . len ( ) { 0 => Err ( NewPaletteError :: NoColors ) , _ => { Ok ( Palette { _name : name . to_string ( ) , _colors : colors , } ) } } }
Creates a new named Palette from a non-zero-length collection of Colors.
Creates a new named Palette from a non - zero - length collection of Colors .
name
S
colors
Vec<Color>
name
S
colors
Vec<Color>