Function palette::cast::from_uint_ref

source ยท
pub fn from_uint_ref<T>(value: &T::Uint) -> &T
where T: UintCast,
Expand description

Cast from an unsigned integer reference to a color type reference.

use palette::{cast, rgb::PackedArgb, Srgba};

let color: PackedArgb = Srgba::new(0x17, 0xC6, 0x4C, 0xFF).into();
assert_eq!(cast::from_uint_ref::<PackedArgb>(&0xFF17C64C), &color);