pub struct Palette {
pub accent: u32,
pub bg: u32,
pub fg: u32,
pub bg_lifted: u32,
pub fg_dim: u32,
pub cert_secure: u32,
pub cert_insecure: u32,
pub private: u32,
pub progress: u32,
pub update: u32,
}Expand description
Single source of truth for chrome colours. Built from a base
accent plus a handful of semantic signals (cert state, private
marker, update indicator, progress bar). The non-accent fields
default to the historical fixed signals but are configurable via
config.theme.*.
Fields§
§accent: u32Base accent. Drives the mode block, active-tab indicator, and (darkened) the strip background.
bg: u32Strip / tab background — accent mixed heavily with black.
fg: u32Body text. Held at near-white for legibility regardless of accent hue; only the high-contrast palette overrides this.
bg_lifted: u32Inactive-tab background — slightly lifted from bg so tabs
read as distinct without being visually loud.
fg_dim: u32Inactive-tab foreground — dimmed fg.
cert_secure: u32Cert-state secure (lock icon, find counts).
cert_insecure: u32Cert-state insecure.
private: u32PRIVATE marker on the right-hand statusline cell.
progress: u32Page-load progress bar.
update: u32Update channel indicator (* upd).
Implementations§
Source§impl Palette
impl Palette
Sourcepub fn from_accent(accent: u32) -> Self
pub fn from_accent(accent: u32) -> Self
Derive a palette from a single base accent. bg is the accent
mixed 92% with black; bg_lifted is the accent mixed 80%;
fg_dim is fg mixed 35% with black. Semantic colours fall
back to fixed signal values — callers override via
Palette::with_signals.
Sourcepub fn with_signals(
self,
cert_secure: u32,
cert_insecure: u32,
private: u32,
progress: u32,
update: u32,
) -> Self
pub fn with_signals( self, cert_secure: u32, cert_insecure: u32, private: u32, progress: u32, update: u32, ) -> Self
Override the semantic-signal colours. Used when wiring
config.theme.{cert_secure,cert_insecure,private,progress,update}.
Sourcepub fn high_contrast() -> Self
pub fn high_contrast() -> Self
Phase 6 high-contrast palette. Documented in docs/accessibility.md.
Pure white-on-black + saturated yellow accent that survives both
black and white backgrounds. Semantic signals collapse to white
so the chrome stays legible for low-vision users.
Trait Implementations§
impl Copy for Palette
impl Eq for Palette
impl StructuralPartialEq for Palette
Auto Trait Implementations§
impl Freeze for Palette
impl RefUnwindSafe for Palette
impl Send for Palette
impl Sync for Palette
impl Unpin for Palette
impl UnsafeUnpin for Palette
impl UnwindSafe for Palette
Blanket Implementations§
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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