Enum PresenceHue
pub enum PresenceHue {
Red,
Orange,
Amber,
Olive,
Green,
Teal,
Cyan,
Sky,
Blue,
Violet,
Magenta,
Pink,
}Expand description
One of the twelve presence hues: a person’s colour, as they choose it.
A colour is part of someone’s identity, not of a theme: it is stored as
this choice and painted through whatever theme each viewer uses
(PresencePalette::hue), so it reads at that theme’s presence
lightness and chroma everywhere.
Variants§
Implementations§
§impl PresenceHue
impl PresenceHue
pub const ALL: [PresenceHue; 12]
pub const ALL: [PresenceHue; 12]
Every hue, in PRESENCE_HUES order.
pub fn from_slot(slot: usize) -> PresenceHue
pub fn from_slot(slot: usize) -> PresenceHue
The hue at slot, wrapping past PRESENCE_LEN.
pub fn from_id(id: &str) -> Option<PresenceHue>
pub fn from_id(id: &str) -> Option<PresenceHue>
Parse Self::id.
pub fn nearest(colour: AlphaColor<Srgb>) -> Option<PresenceHue>
pub fn nearest(colour: AlphaColor<Srgb>) -> Option<PresenceHue>
The hue nearest to colour’s, for a colour that arrives from outside
(a host’s accent). A grey has no hue and gives None.
pub fn of_identity(id: &str) -> PresenceHue
pub fn of_identity(id: &str) -> PresenceHue
The colour someone wears until they choose one: a pure function of
their identity, so every host paints them the same without asking.
The fixture names me, alice, bob and charlie are pinned so
demos and tests stay recognisable.
pub fn chosen_in(settings: &Value) -> Option<PresenceHue>
pub fn chosen_in(settings: &Value) -> Option<PresenceHue>
The person’s stored choice in a settings document
(identity.colour), if they made one.
Trait Implementations§
§impl Clone for PresenceHue
impl Clone for PresenceHue
§fn clone(&self) -> PresenceHue
fn clone(&self) -> PresenceHue
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 PresenceHue
impl Debug for PresenceHue
§impl<'de> Deserialize<'de> for PresenceHue
impl<'de> Deserialize<'de> for PresenceHue
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PresenceHue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PresenceHue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Hash for PresenceHue
impl Hash for PresenceHue
§impl PartialEq for PresenceHue
impl PartialEq for PresenceHue
§impl Serialize for PresenceHue
impl Serialize for PresenceHue
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for PresenceHue
impl Eq for PresenceHue
impl StructuralPartialEq for PresenceHue
Auto Trait Implementations§
impl Freeze for PresenceHue
impl RefUnwindSafe for PresenceHue
impl Send for PresenceHue
impl Sync for PresenceHue
impl Unpin for PresenceHue
impl UnsafeUnpin for PresenceHue
impl UnwindSafe for PresenceHue
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<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
key and return true if they are equal.§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
§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