Function cosmic::cosmic_theme::palette::cast::into_array_vec

source ยท
pub fn into_array_vec<T>(values: Vec<T>) -> Vec<<T as ArrayCast>::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]]
)