Function cosmic::cosmic_theme::palette::cast::into_array_slice_mut

source ยท
pub fn into_array_slice_mut<T>(
    values: &mut [T],
) -> &mut [<T as ArrayCast>::Array]
where T: ArrayCast,
Expand description

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

use palette::{cast, Srgb};

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