cosmic::cosmic_theme::palette::cast

Function from_array_slice

source
pub fn from_array_slice<T>(values: &[<T as ArrayCast>::Array]) -> &[T]
where T: ArrayCast,
Expand description

Cast from a slice of arrays to a slice of colors.

use palette::{cast, Srgb};

let arrays = &[[64, 139, 10], [93, 18, 214]];
assert_eq!(
    cast::from_array_slice::<Srgb<u8>>(arrays),
    &[Srgb::new(64u8, 139, 10), Srgb::new(93, 18, 214)]
)