#[non_exhaustive]pub struct Palette {Show 15 fields
pub fg: Color,
pub fg_dim: Color,
pub bg: Color,
pub surface: Color,
pub overlay: Color,
pub accent: Color,
pub on_accent: Color,
pub selection: Color,
pub border: Color,
pub border_active: Color,
pub success: Color,
pub warning: Color,
pub error: Color,
pub info: Color,
pub placeholder: Color,
}Expand description
语义色板——主题系统的唯一颜色真源。
每个内置组件的 FooTheme::from_palette 只从这里取色;改这一处即可统一全部组件观感。
标注 #[non_exhaustive]:后续新增语义色不构成对下游的破坏性变更。下游经
Palette::default + 字段修改构造,而非结构体字面量。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.fg: Color主前景色(正文文字)。
fg_dim: Color弱化前景(次要文字、禁用态)。
bg: Color主背景色。
surface: Color面板/容器表面色(比 bg 略微抬升的层)。
overlay: Color遮罩层底色(模态背景)。
accent: Color强调色(高亮、激活边框、选中背景)。
on_accent: Color强调底色其上的前景(如高亮行的文字色,与 accent/selection 配对)。
selection: Color选中项背景。
border: Color常态边框色。
border_active: Color激活/聚焦边框色。
success: Color成功语义色。
warning: Color警告语义色。
error: Color错误语义色。
info: Color信息语义色。
placeholder: Color占位符/提示文字色。
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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