pub struct RGBA {
pub r: u8,
pub g: u8,
pub b: u8,
pub a: u8,
}Expand description
An 8-bit-per-channel RGBA color.
Every channel is 0..=255; a is opacity, with 255 fully opaque.
Fields§
§r: u8Red channel.
g: u8Green channel.
b: u8Blue channel.
a: u8Alpha channel.
Implementations§
Source§impl RGBA
impl RGBA
Sourcepub const T_PURPLE: RGBA
pub const T_PURPLE: RGBA
Magenta for T blocks, kept clear of Self::Y_GREEN.
Sourcepub const LINE_BLACK: RGBA
pub const LINE_BLACK: RGBA
Opaque black for outlines and edges.
Sourcepub const X_PURE_RED: RGBA
pub const X_PURE_RED: RGBA
Fully saturated red for the Pauli X axis.
Sourcepub const Y_PURE_GREEN: RGBA
pub const Y_PURE_GREEN: RGBA
Fully saturated green for the Pauli Y axis.
Sourcepub const Z_PURE_BLUE: RGBA
pub const Z_PURE_BLUE: RGBA
Fully saturated blue for the Pauli Z axis.
Sourcepub const fn from_hex(rgb_hex: u32, alpha: u8) -> Self
pub const fn from_hex(rgb_hex: u32, alpha: u8) -> Self
Builds a color from a packed 0xRRGGBB value and a separate alpha.
Sourcepub const fn to_f32_array(self) -> [f32; 4]
pub const fn to_f32_array(self) -> [f32; 4]
Converts to a normalized [r, g, b, a] array with each channel in 0.0..=1.0.
Trait Implementations§
impl Copy for RGBA
impl Eq for RGBA
Source§impl From<PauliBasis> for RGBA
impl From<PauliBasis> for RGBA
Source§fn from(basis: PauliBasis) -> Self
fn from(basis: PauliBasis) -> Self
Converts to this type from the input type.
Source§impl Ord for RGBA
impl Ord for RGBA
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for RGBA
impl PartialOrd for RGBA
impl StructuralPartialEq for RGBA
Auto Trait Implementations§
impl Freeze for RGBA
impl RefUnwindSafe for RGBA
impl Send for RGBA
impl Sync for RGBA
impl Unpin for RGBA
impl UnsafeUnpin for RGBA
impl UnwindSafe for RGBA
Blanket Implementations§
§impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
fn assign_index(&mut self, index: usize, to: bool)
fn negate_index(&mut self, index: usize)
fn clear_bits(&mut self)
fn assign_random(
&mut self,
bit_count: usize,
random_number_generator: &mut impl RngExt,
)where
BorrowedSelf: BitLength,
§impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
fn assign(&mut self, other: &Other)
fn bitxor_assign(&mut self, other: &Other)
fn bitand_assign(&mut self, other: &Other)
fn bitor_assign(&mut self, other: &Other)
§impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
§impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
fn index(&self, index: usize) -> bool
fn weight(&self) -> usize
fn parity(&self) -> bool
fn is_zero(&self) -> bool
fn is_unit(&self, index: usize) -> bool
fn support<'a>(&'a self) -> impl SortedIteratorwhere
BorrowedSelf: 'a,
fn max_support(&self) -> Option<usize>
fn min_support(&self) -> Option<usize>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.