Struct PresencePalette
pub struct PresencePalette {
pub lightness: f32,
pub chroma: f32,
pub colors: [AlphaColor<Srgb>; 12],
}Expand description
One colour per participant: PRESENCE_HUES at one OKLCH lightness and
chroma, so they differ in hue only and no participant looks more
important than another. Where sRGB cannot carry the full chroma at a hue
(a light cyan) only that hue’s chroma drops; lightness never does.
Fields§
§lightness: f32§chroma: f32§colors: [AlphaColor<Srgb>; 12]Implementations§
§impl PresencePalette
impl PresencePalette
pub fn new(lightness: f32, chroma: f32) -> PresencePalette
pub fn get(&self, slot: usize) -> AlphaColor<Srgb>
pub fn get(&self, slot: usize) -> AlphaColor<Srgb>
Slot slot, wrapping past PRESENCE_LEN.
pub fn series(&self, index: usize) -> AlphaColor<Srgb>
pub fn series(&self, index: usize) -> AlphaColor<Srgb>
The indexth colour of a data series (chart categories, tag
colours): the same twelve hues, walked so the first six are at least
60° apart from each other (consecutive ones mostly 120°–180°), the
next six fill the gaps, and the walk wraps past PRESENCE_LEN.
Equal lightness and chroma keep every series equally loud.
pub fn hue(&self, hue: PresenceHue) -> AlphaColor<Srgb>
pub fn hue(&self, hue: PresenceHue) -> AlphaColor<Srgb>
A person’s colour as this palette paints it.
pub fn of(&self, identity: AlphaColor<Srgb>) -> AlphaColor<Srgb>
pub fn of(&self, identity: AlphaColor<Srgb>) -> AlphaColor<Srgb>
An identity colour (a roster choice, a hashed id, an avatar colour)
as this palette paints it: its hue at the palette’s lightness and
chroma. Identities travel between devices and themes as colours;
painting them through here keeps every participant equal on every
ground. A grey identity has no hue and takes PresenceHue::Blue.
Trait Implementations§
§impl Clone for PresencePalette
impl Clone for PresencePalette
§fn clone(&self) -> PresencePalette
fn clone(&self) -> PresencePalette
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for PresencePalette
impl Debug for PresencePalette
§impl PartialEq for PresencePalette
impl PartialEq for PresencePalette
impl Copy for PresencePalette
impl StructuralPartialEq for PresencePalette
Auto Trait Implementations§
impl Freeze for PresencePalette
impl RefUnwindSafe for PresencePalette
impl Send for PresencePalette
impl Sync for PresencePalette
impl Unpin for PresencePalette
impl UnsafeUnpin for PresencePalette
impl UnwindSafe for PresencePalette
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more