Draft Highlighter API
This commit is contained in:
parent
723111bb0d
commit
76dc82e8e8
10 changed files with 218 additions and 19 deletions
|
|
@ -10,7 +10,7 @@ pub use cosmic_text;
|
|||
|
||||
use crate::core::font::{self, Font};
|
||||
use crate::core::text::Shaping;
|
||||
use crate::core::Size;
|
||||
use crate::core::{Color, Size};
|
||||
|
||||
use once_cell::sync::OnceCell;
|
||||
use std::borrow::Cow;
|
||||
|
|
@ -129,3 +129,9 @@ pub fn to_shaping(shaping: Shaping) -> cosmic_text::Shaping {
|
|||
Shaping::Advanced => cosmic_text::Shaping::Advanced,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_color(color: Color) -> cosmic_text::Color {
|
||||
let [r, g, b, a] = color.into_rgba8();
|
||||
|
||||
cosmic_text::Color::rgba(r, g, b, a)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue