Emit accurate hex colors in generated themes (#3547)
This PR fixes an issues where the hex colors in the generated themes were not correct. We're using the [`palette`](https://crates.io/crates/palette) crate to perform the conversions, as this gives us accurate hex codes that match the VS Code source themes. Release Notes: - N/A
This commit is contained in:
parent
0b78a401de
commit
c7e19c0bcd
17 changed files with 974 additions and 871 deletions
|
@ -1,5 +1,5 @@
|
|||
use anyhow::Result;
|
||||
use gpui::{rgba, Hsla, Rgba};
|
||||
use gpui::rgba;
|
||||
use indexmap::IndexMap;
|
||||
use strum::IntoEnumIterator;
|
||||
use theme::{
|
||||
|
@ -7,16 +7,13 @@ use theme::{
|
|||
UserHighlightStyle, UserSyntaxTheme, UserTheme, UserThemeStylesRefinement,
|
||||
};
|
||||
|
||||
use crate::color::try_parse_color;
|
||||
use crate::util::Traverse;
|
||||
use crate::vscode::VsCodeTheme;
|
||||
use crate::ThemeMetadata;
|
||||
|
||||
use super::ZedSyntaxToken;
|
||||
|
||||
pub(crate) fn try_parse_color(color: &str) -> Result<Hsla> {
|
||||
Ok(Rgba::try_from(color)?.into())
|
||||
}
|
||||
|
||||
pub(crate) fn try_parse_font_weight(font_style: &str) -> Option<UserFontWeight> {
|
||||
match font_style {
|
||||
style if style.contains("bold") => Some(UserFontWeight::BOLD),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue