cosmic::cosmic_theme::palette::cast

Function from_array_slice_box

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

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

use palette::{cast, Srgb};

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