pub struct ParseNodeColor {
pub mode: Mode,
pub loc: Option<SourceLocation>,
pub color: String,
pub body: Vec<AnyParseNode>,
}
Expand description
Represents color changes applied to mathematical expressions.
This struct wraps mathematical content with color specifications, allowing different parts of expressions to be rendered in different colors.
§Fields
mode
- The parsing mode (Mode::Math
orMode::Text
)loc
- Optional source location for error reportingcolor
- The color specification (name, hex code, or RGB values)body
- The mathematical expressions to be colored
§LaTeX Correspondence
Corresponds to LaTeX color commands:
\color{red}{x + y}
{\color{blue} \frac{a}{b}}
§Usage
Color nodes allow visual distinction of different parts of mathematical expressions, useful for highlighting important terms or distinguishing different variables.
Fields§
§mode: Mode
The parsing mode (Mode::Math
or Mode::Text
)
loc: Option<SourceLocation>
Optional source location for error reporting
color: String
The color specification (name, hex code, or RGB values)
body: Vec<AnyParseNode>
The mathematical expressions to be colored
Trait Implementations§
Source§impl Clone for ParseNodeColor
impl Clone for ParseNodeColor
Source§fn clone(&self) -> ParseNodeColor
fn clone(&self) -> ParseNodeColor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParseNodeColor
impl Debug for ParseNodeColor
Source§impl From<ParseNodeColor> for AnyParseNode
impl From<ParseNodeColor> for AnyParseNode
Source§fn from(node: ParseNodeColor) -> Self
fn from(node: ParseNodeColor) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ParseNodeColor
impl PartialEq for ParseNodeColor
impl StructuralPartialEq for ParseNodeColor
Auto Trait Implementations§
impl Freeze for ParseNodeColor
impl RefUnwindSafe for ParseNodeColor
impl Send for ParseNodeColor
impl Sync for ParseNodeColor
impl Unpin for ParseNodeColor
impl UnwindSafe for ParseNodeColor
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