pub struct Theme {Show 49 fields
pub bg_primary: u32,
pub bg_secondary: u32,
pub bg_input: u32,
pub bg_input_hover: u32,
pub bg_hover: u32,
pub bg_section_header: u32,
pub bg_section_header_hover: u32,
pub bg_white: u32,
pub bg_light_hover: u32,
pub text_primary: u32,
pub text_label: u32,
pub text_section_header: u32,
pub text_value: u32,
pub text_muted: u32,
pub text_placeholder: u32,
pub text_dimmed: u32,
pub text_icon: u32,
pub text_dark: u32,
pub text_black: u32,
pub border_default: u32,
pub border_checkbox: u32,
pub border_input: u32,
pub border_menu: u32,
pub border_focus: u32,
pub border_focus_on_color: u32,
pub border_error: u32,
pub primary: u32,
pub primary_hover: u32,
pub primary_active: u32,
pub accent: u32,
pub success: u32,
pub error: u32,
pub warning: u32,
pub error_text: u32,
pub tooltip_bg: u32,
pub tooltip_border: u32,
pub tooltip_text: u32,
pub selection: u32,
pub disabled_bg: u32,
pub disabled_text: u32,
pub secondary_bg: u32,
pub secondary_bg_hover: u32,
pub secondary_bg_active: u32,
pub secondary_border: u32,
pub bg_tab_hover: u32,
pub border_tab_active: u32,
pub delete_bg: u32,
pub delete_bg_hover: u32,
pub bg_path_hover: u32,
}Expand description
Theme configuration for widgets
All colors are stored as u32 hex values (0xRRGGBB format).
Use with GPUI’s rgb() macro: rgb(theme.bg_primary)
Fields§
§bg_primary: u32Main application background (darkest)
bg_secondary: u32Panel/section background (slightly lighter)
bg_input: u32Input field background
bg_input_hover: u32Input field background when hovered
bg_hover: u32Button/interactive element hover background
bg_section_header: u32Section header background
bg_section_header_hover: u32Section header hover background
bg_white: u32White background for light-themed elements
bg_light_hover: u32Light hover background
text_primary: u32Primary text color
text_label: u32Label text color
text_section_header: u32Section header text color
text_value: u32Value/content text color
text_muted: u32Muted/secondary text color
text_placeholder: u32Placeholder text color
text_dimmed: u32Dimmed/disabled text color
text_icon: u32Icon text color
text_dark: u32Dark text (on light backgrounds)
text_black: u32Black text
border_default: u32Standard border color
border_checkbox: u32Checkbox/radio button border
border_input: u32Input field border
Menu/dropdown border
border_focus: u32Focus/active border
border_focus_on_color: u32Focus border for colored backgrounds (e.g., primary buttons) Should contrast with primary/accent colored elements
border_error: u32Error border
primary: u32Primary accent color (buttons, checkboxes)
primary_hover: u32Primary hover state
primary_active: u32Primary active/pressed state
accent: u32Accent color (focus rings, selections)
success: u32Success/positive color (green)
error: u32Error/negative color (red)
warning: u32Warning color (orange)
error_text: u32Validation error text
tooltip_bg: u32Tooltip background
tooltip_border: u32Tooltip border
tooltip_text: u32Tooltip text
selection: u32§disabled_bg: u32Disabled button background
disabled_text: u32Disabled button text
secondary_bg: u32Secondary button background
secondary_bg_hover: u32Secondary button hover background
secondary_bg_active: u32Secondary button active background
secondary_border: u32Secondary button border
bg_tab_hover: u32Tab hover background
border_tab_active: u32Active tab border
delete_bg: u32Delete button background
delete_bg_hover: u32Delete button hover background
bg_path_hover: u32Path display hover background
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn from_palette(palette: Palette) -> Self
pub fn from_palette(palette: Palette) -> Self
Create a theme from a minimal color palette
This derives all 52 theme colors from just 7 seed colors, making it easy to create cohesive custom themes.
§Example
use ccf_gpui_widgets::{Theme, Palette};
// Use preset palettes
let dark_theme = Theme::from_palette(Palette::dark());
let light_theme = Theme::from_palette(Palette::light());
// Customize brand colors
let custom = Theme::from_palette(
Palette::dark()
.with_primary(0xe94560)
.with_accent(0x0f3460)
);Sourcepub fn with_accent(self, color: u32) -> Self
pub fn with_accent(self, color: u32) -> Self
Set the accent color
Sourcepub fn with_primary(self, color: u32) -> Self
pub fn with_primary(self, color: u32) -> Self
Set the primary color
Sourcepub fn with_primary_hover(self, color: u32) -> Self
pub fn with_primary_hover(self, color: u32) -> Self
Set the primary hover color
Sourcepub fn with_border_focus(self, color: u32) -> Self
pub fn with_border_focus(self, color: u32) -> Self
Set the focus border color
Sourcepub fn with_border_focus_on_color(self, color: u32) -> Self
pub fn with_border_focus_on_color(self, color: u32) -> Self
Set the focus border color for colored backgrounds
Sourcepub fn with_success(self, color: u32) -> Self
pub fn with_success(self, color: u32) -> Self
Set the success color
Sourcepub fn with_error(self, color: u32) -> Self
pub fn with_error(self, color: u32) -> Self
Set the error color
Sourcepub fn with_warning(self, color: u32) -> Self
pub fn with_warning(self, color: u32) -> Self
Set the warning color
Sourcepub fn with_bg_primary(self, color: u32) -> Self
pub fn with_bg_primary(self, color: u32) -> Self
Set the primary background color
Sourcepub fn with_bg_input(self, color: u32) -> Self
pub fn with_bg_input(self, color: u32) -> Self
Set the input background color
Sourcepub fn with_text_primary(self, color: u32) -> Self
pub fn with_text_primary(self, color: u32) -> Self
Set the primary text color
Sourcepub fn with_bg_secondary(self, color: u32) -> Self
pub fn with_bg_secondary(self, color: u32) -> Self
Set the secondary background color
Sourcepub fn with_bg_input_hover(self, color: u32) -> Self
pub fn with_bg_input_hover(self, color: u32) -> Self
Set the input hover background color
Sourcepub fn with_bg_hover(self, color: u32) -> Self
pub fn with_bg_hover(self, color: u32) -> Self
Set the hover background color
Sourcepub fn with_bg_section_header(self, color: u32) -> Self
pub fn with_bg_section_header(self, color: u32) -> Self
Set the section header background color
Sourcepub fn with_bg_section_header_hover(self, color: u32) -> Self
pub fn with_bg_section_header_hover(self, color: u32) -> Self
Set the section header hover background color
Sourcepub fn with_bg_white(self, color: u32) -> Self
pub fn with_bg_white(self, color: u32) -> Self
Set the white background color
Sourcepub fn with_bg_light_hover(self, color: u32) -> Self
pub fn with_bg_light_hover(self, color: u32) -> Self
Set the light hover background color
Sourcepub fn with_text_label(self, color: u32) -> Self
pub fn with_text_label(self, color: u32) -> Self
Set the label text color
Sourcepub fn with_text_section_header(self, color: u32) -> Self
pub fn with_text_section_header(self, color: u32) -> Self
Set the section header text color
Sourcepub fn with_text_value(self, color: u32) -> Self
pub fn with_text_value(self, color: u32) -> Self
Set the value text color
Sourcepub fn with_text_muted(self, color: u32) -> Self
pub fn with_text_muted(self, color: u32) -> Self
Set the muted text color
Sourcepub fn with_text_placeholder(self, color: u32) -> Self
pub fn with_text_placeholder(self, color: u32) -> Self
Set the placeholder text color
Sourcepub fn with_text_dimmed(self, color: u32) -> Self
pub fn with_text_dimmed(self, color: u32) -> Self
Set the dimmed text color
Sourcepub fn with_text_icon(self, color: u32) -> Self
pub fn with_text_icon(self, color: u32) -> Self
Set the icon text color
Sourcepub fn with_text_dark(self, color: u32) -> Self
pub fn with_text_dark(self, color: u32) -> Self
Set the dark text color
Sourcepub fn with_text_black(self, color: u32) -> Self
pub fn with_text_black(self, color: u32) -> Self
Set the black text color
Sourcepub fn with_border_default(self, color: u32) -> Self
pub fn with_border_default(self, color: u32) -> Self
Set the default border color
Sourcepub fn with_border_checkbox(self, color: u32) -> Self
pub fn with_border_checkbox(self, color: u32) -> Self
Set the checkbox border color
Sourcepub fn with_border_input(self, color: u32) -> Self
pub fn with_border_input(self, color: u32) -> Self
Set the input border color
Set the menu border color
Sourcepub fn with_border_error(self, color: u32) -> Self
pub fn with_border_error(self, color: u32) -> Self
Set the error border color
Sourcepub fn with_primary_active(self, color: u32) -> Self
pub fn with_primary_active(self, color: u32) -> Self
Set the primary active color
Sourcepub fn with_error_text(self, color: u32) -> Self
pub fn with_error_text(self, color: u32) -> Self
Set the error text color
Sourcepub fn with_tooltip_bg(self, color: u32) -> Self
pub fn with_tooltip_bg(self, color: u32) -> Self
Set the tooltip background color
Sourcepub fn with_tooltip_border(self, color: u32) -> Self
pub fn with_tooltip_border(self, color: u32) -> Self
Set the tooltip border color
Sourcepub fn with_tooltip_text(self, color: u32) -> Self
pub fn with_tooltip_text(self, color: u32) -> Self
Set the tooltip text color
Sourcepub fn with_selection(self, color: u32) -> Self
pub fn with_selection(self, color: u32) -> Self
Set the selection highlight color
Sourcepub fn with_disabled_bg(self, color: u32) -> Self
pub fn with_disabled_bg(self, color: u32) -> Self
Set the disabled button background color
Sourcepub fn with_disabled_text(self, color: u32) -> Self
pub fn with_disabled_text(self, color: u32) -> Self
Set the disabled button text color
Sourcepub fn with_secondary_bg(self, color: u32) -> Self
pub fn with_secondary_bg(self, color: u32) -> Self
Set the secondary button background color
Sourcepub fn with_secondary_bg_hover(self, color: u32) -> Self
pub fn with_secondary_bg_hover(self, color: u32) -> Self
Set the secondary button hover background color
Sourcepub fn with_secondary_bg_active(self, color: u32) -> Self
pub fn with_secondary_bg_active(self, color: u32) -> Self
Set the secondary button active background color
Sourcepub fn with_secondary_border(self, color: u32) -> Self
pub fn with_secondary_border(self, color: u32) -> Self
Set the secondary button border color
Sourcepub fn with_bg_tab_hover(self, color: u32) -> Self
pub fn with_bg_tab_hover(self, color: u32) -> Self
Set the tab hover background color
Sourcepub fn with_border_tab_active(self, color: u32) -> Self
pub fn with_border_tab_active(self, color: u32) -> Self
Set the active tab border color
Sourcepub fn with_delete_bg(self, color: u32) -> Self
pub fn with_delete_bg(self, color: u32) -> Self
Set the delete button background color
Sourcepub fn with_delete_bg_hover(self, color: u32) -> Self
pub fn with_delete_bg_hover(self, color: u32) -> Self
Set the delete button hover background color
Sourcepub fn with_bg_path_hover(self, color: u32) -> Self
pub fn with_bg_path_hover(self, color: u32) -> Self
Set the path display hover background color
Trait Implementations§
impl Copy for Theme
impl Global for Theme
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReadGlobal for Twhere
T: Global,
impl<T> ReadGlobal for Twhere
T: Global,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().