apply tmp solution to rgba option set #1931

This commit is contained in:
yggverse 2024-12-03 02:58:13 +02:00
parent bb98d1658e
commit c0d372a0d2

View File

@ -51,7 +51,7 @@ impl Syntax {
// Create new tag from source preset // Create new tag from source preset
let mut tag = TextTag::new(None); let mut tag = TextTag::new(None);
tag.clone_from(source_tag); // @TODO copy preset tag.clone_from(source_tag);
// Append // Append
buffer.push((tag, source.to_string())); buffer.push((tag, source.to_string()));
@ -75,7 +75,7 @@ impl Syntax {
for (style, entity) in ranges { for (style, entity) in ranges {
// Create new tag from source preset // Create new tag from source preset
let mut tag = TextTag::new(None); let mut tag = TextTag::new(None);
tag.clone_from(source_tag); // @TODO copy preset tag.clone_from(source_tag);
// Tuneup using syntect conversion // Tuneup using syntect conversion
tag.set_background_rgba(Some(&color_to_rgba(style.background))); tag.set_background_rgba(Some(&color_to_rgba(style.background)));
@ -94,12 +94,19 @@ impl Syntax {
// Tools // Tools
fn color_to_rgba(color: Color) -> RGBA { fn color_to_rgba(color: Color) -> RGBA {
/* @TODO #1931
RGBA::new( RGBA::new(
color.r.into(), color.r.into(),
color.g.into(), color.g.into(),
color.b.into(), color.b.into(),
color.a.into(), color.a.into(),
) )*/
RGBA::parse(format!(
"rgba({},{},{},{})",
color.r, color.g, color.b, color.a
))
.unwrap()
} }
fn font_style_to_style(font_style: FontStyle) -> Style { fn font_style_to_style(font_style: FontStyle) -> Style {