palette::cast

Function into_array_vec

source
pub fn into_array_vec<T>(values: Vec<T>) -> Vec<T::Array>
where T: ArrayCast,
Expand description

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

use palette::{cast, Srgb};

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