pub struct CodeTheme {Show 26 fields
pub background: Color,
pub foreground: Color,
pub gutter_bg: Color,
pub line_number: Color,
pub active_line_number: Color,
pub active_line_bg: Color,
pub active_line_ring: Color,
pub search_match_bg: Color,
pub search_active_match_bg: Color,
pub diagnostic_error: Color,
pub diagnostic_warning: Color,
pub diagnostic_info: Color,
pub diagnostic_hint: Color,
pub diagnostic_active_bg: Color,
pub fold_marker: Color,
pub fold_marker_active: Color,
pub fold_guide: Color,
pub syntax_keyword: Color,
pub syntax_type: Color,
pub syntax_function: Color,
pub syntax_string: Color,
pub syntax_number: Color,
pub syntax_comment: Color,
pub syntax_operator: Color,
pub syntax_punctuation: Color,
pub syntax_identifier: Color,
}Expand description
Minimal visual theme for the CodeEditor.
Colors are semantic paint inputs and do not affect shaping/cache geometry.
§Examples
use ailloli_ui_editor::CodeTheme;
assert_eq!(CodeTheme::dark(), CodeTheme::default());Fields§
§background: ColorMain code surface.
foreground: ColorDefault source text.
gutter_bg: ColorGutter surface.
line_number: ColorInactive line numbers.
active_line_number: ColorActive line number.
active_line_bg: ColorActive line fill.
active_line_ring: ColorActive line focus ring.
search_match_bg: ColorInactive search match fill.
search_active_match_bg: ColorActive search match fill.
diagnostic_error: ColorError diagnostic marker/underline.
diagnostic_warning: ColorWarning diagnostic marker/underline.
diagnostic_info: ColorInformation diagnostic marker/underline.
diagnostic_hint: ColorHint diagnostic marker/underline.
diagnostic_active_bg: ColorActive diagnostic line fill.
fold_marker: ColorInactive fold marker.
fold_marker_active: ColorActive fold marker.
fold_guide: ColorFold guide line.
syntax_keyword: ColorSyntax keyword.
syntax_type: ColorSyntax type.
syntax_function: ColorSyntax function.
syntax_string: ColorSyntax string.
syntax_number: ColorSyntax numeric literal.
syntax_comment: ColorSyntax comment.
syntax_operator: ColorSyntax operator.
syntax_punctuation: ColorSyntax punctuation.
syntax_identifier: ColorSyntax identifier/default token.
Implementations§
Source§impl CodeTheme
Code-theme constructors.
impl CodeTheme
Code-theme constructors.
Sourcepub fn dark() -> Self
pub fn dark() -> Self
Returns the framework default dark-derived theme.
§Examples
use ailloli_ui_editor::CodeTheme;
assert_eq!(CodeTheme::dark(), CodeTheme::default());Sourcepub fn from_theme(theme: Theme) -> Self
pub fn from_theme(theme: Theme) -> Self
Maps framework palette roles plus fixed syntax accents into code colors.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_editor::CodeTheme;
let base = Theme::default();
let code = CodeTheme::from_theme(base);
assert_eq!(code.background, base.palette().background);
assert_eq!(code.foreground, base.palette().text);