Expand description
Generic RGB with an alpha component. See the Rgba
implementation in
Alpha
.
Implementations
sourceimpl<S: RgbStandard> Rgba<S, u8>
impl<S: RgbStandard> Rgba<S, u8>
Convenience functions to convert between a packed u32
and Rgba
.
use palette::Srgba;
let rgba = Srgba::from(0x607F00FF);
assert_eq!(Srgba::new(96u8, 127, 0, 255), rgba);
let integer = u32::from(rgba);
assert_eq!(0x607F00FF, integer);
sourcepub fn into_u32<C: RgbChannels>(self) -> u32
pub fn into_u32<C: RgbChannels>(self) -> u32
Convert to a packed u32
with with specifiable component order.
Defaults to ARGB ordering (0xAARRGGBB).
See Packed for more details.
sourcepub fn from_u32<C: RgbChannels>(color: u32) -> Self
pub fn from_u32<C: RgbChannels>(color: u32) -> Self
Convert from a packed u32
with specifiable component order. Defaults
to ARGB ordering (0xAARRGGBB).
See Packed for more details.