Represent theme's syntax colors with string keys

Co-authored-by: Marshall Bowers <marshall@zed.dev>
This commit is contained in:
Max Brunsfeld
2023-10-26 16:38:50 +02:00
co-authored by Marshall Bowers
parent a569c82492
commit 0eae962abf
10 changed files with 156 additions and 132 deletions
+10 -1
View File
@@ -1,7 +1,7 @@
use crate::{
black, phi, point, rems, AbsoluteLength, BorrowAppContext, BorrowWindow, Bounds, ContentMask,
Corners, CornersRefinement, DefiniteLength, Edges, EdgesRefinement, Font, FontFeatures,
FontStyle, FontWeight, Hsla, Length, Pixels, Point, PointRefinement, Rems, Result,
FontStyle, FontWeight, Hsla, Length, Pixels, Point, PointRefinement, Rems, Result, Rgba,
SharedString, Size, SizeRefinement, Styled, TextRun, ViewContext, WindowContext,
};
use refineable::{Cascade, Refineable};
@@ -417,3 +417,12 @@ impl From<Hsla> for HighlightStyle {
}
}
}
impl From<Rgba> for HighlightStyle {
fn from(color: Rgba) -> Self {
Self {
color: Some(color.into()),
..Default::default()
}
}
}