Function palette::cast::into_array_slice_box

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

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

use palette::{cast, Srgb};

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