palette::cast

Function from_array_vec

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

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

use palette::{cast, Srgb};

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