diff --git a/parley/src/editor/layout.rs b/parley/src/editor/layout.rs index 600c18cd..06a88a80 100644 --- a/parley/src/editor/layout.rs +++ b/parley/src/editor/layout.rs @@ -70,6 +70,15 @@ pub enum TextBrush { }, } +impl TextBrush { + pub fn text_brush(&self) -> &peniko::Brush { + match self { + TextBrush::Normal(brush) => brush, + TextBrush::Highlight { text, .. } => text, + } + } +} + impl From for TextBrush { fn from(value: peniko::Brush) -> Self { Self::Normal(value)