pub struct Palette {Show 22 fields
pub is_dark: bool,
pub bg: Color32,
pub card: Color32,
pub input_bg: Color32,
pub border: Color32,
pub text: Color32,
pub text_muted: Color32,
pub text_faint: Color32,
pub blue: Color32,
pub blue_hover: Color32,
pub green: Color32,
pub green_hover: Color32,
pub red: Color32,
pub red_hover: Color32,
pub purple: Color32,
pub purple_hover: Color32,
pub amber: Color32,
pub amber_hover: Color32,
pub sky: Color32,
pub success: Color32,
pub danger: Color32,
pub warning: Color32,
}Expand description
All the colours used by the design system.
You can tweak individual fields before calling Theme::install if you
want to nudge the default slate look.
Fields§
§is_dark: boolWhether this palette is a dark-mode palette.
Drives Visuals::dark vs Visuals::light and flips the
direction of subtle-lift mixes (see Palette::depth_tint).
If you build a custom palette, set this to match the luminance of
bg / card.
bg: Color32Overall application background.
card: Color32Card / panel surface colour.
input_bg: Color32Input field background (typically the same as bg).
border: Color32Border colour used for inputs, cards and separators.
text: Color32Primary text colour.
text_muted: Color32Secondary text (labels, field captions).
text_faint: Color32Tertiary text (hints, placeholders, disabled-ish).
blue: Color32Blue accent, resting state — backs Accent::Blue.
blue_hover: Color32Blue accent, hover/pressed state.
green: Color32Green accent, resting state — backs Accent::Green.
green_hover: Color32Green accent, hover/pressed state.
red: Color32Red accent, resting state — backs Accent::Red.
red_hover: Color32Red accent, hover/pressed state.
purple: Color32Purple accent, resting state — backs Accent::Purple.
purple_hover: Color32Purple accent, hover/pressed state.
amber: Color32Amber accent, resting state — backs Accent::Amber.
amber_hover: Color32Amber accent, hover/pressed state.
sky: Color32The sky blue used for focus rings, active tabs, and “dirty” input bars.
success: Color32Success accent used by the status light and flashy feedback.
danger: Color32Danger accent used by the status light and flashy feedback.
warning: Color32Warning accent used by the “connecting” status light.
Implementations§
Source§impl Palette
impl Palette
Sourcepub fn slate() -> Self
pub fn slate() -> Self
The default “slate” palette — cool corporate dark blue with a sky focus ring. Matches the reference design.
Sourcepub fn charcoal() -> Self
pub fn charcoal() -> Self
The “charcoal” palette — a neutral dark-grey surface with a
cyan focus accent. Minimalist and monochrome compared to the
blue-tinged Palette::slate.
Sourcepub fn frost() -> Self
pub fn frost() -> Self
The “frost” palette — the light-mode counterpart to
Palette::slate. Slate-tinted off-white surfaces, deep slate
text, and the same cool accent family with slightly deepened
shades so white-on-accent button labels remain legible.
Sourcepub fn paper() -> Self
pub fn paper() -> Self
The “paper” palette — the light-mode counterpart to
Palette::charcoal. Warm neutral off-white surfaces with a
darkened cyan focus accent to match charcoal’s cool accent flavour.
Sourcepub fn depth_tint(&self, base: Color32, t: f32) -> Color32
pub fn depth_tint(&self, base: Color32, t: f32) -> Color32
Mix base toward a “more recessed” colour by factor t.
In dark palettes this mixes toward white (adding luminance — a subtle lift); in light palettes it mixes toward black (removing luminance — a subtle shade). Either way the result pops slightly off the neighbouring surface. Used for hover states on otherwise plain fills, and the faint card-ish backgrounds.
Sourcepub fn accent_fill(&self, accent: Accent) -> Color32
pub fn accent_fill(&self, accent: Accent) -> Color32
Resolve the resting fill colour for a given accent.
Sourcepub fn accent_hover(&self, accent: Accent) -> Color32
pub fn accent_hover(&self, accent: Accent) -> Color32
Resolve the hover / pressed fill colour for a given accent.