From 2517b1017b66af2321d0481214b7f4d009514d06 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 8 Dec 2023 16:35:54 -0500 Subject: [PATCH] Weight scope matches to improve results --- crates/theme2/src/themes/andromeda.rs | 4 +- crates/theme2/src/themes/ayu.rs | 30 +++++------ crates/theme2/src/themes/gruvbox.rs | 60 +++++++++++----------- crates/theme2/src/themes/night_owl.rs | 26 +++++++--- crates/theme2/src/themes/noctis.rs | 22 ++++---- crates/theme2/src/themes/nord.rs | 2 +- crates/theme2/src/themes/palenight.rs | 36 ++++++------- crates/theme2/src/themes/rose_pine.rs | 45 ++++++++-------- crates/theme2/src/themes/solarized.rs | 14 ++--- crates/theme2/src/themes/synthwave_84.rs | 3 +- crates/theme_importer/src/vscode/syntax.rs | 16 ++++-- 11 files changed, 141 insertions(+), 117 deletions(-) diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 031dd510252903763d6c3f064479fb94e23f4b38..b71e02d0f5e808e248e9f710fddf5752555ef631 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -198,7 +198,7 @@ pub fn andromeda() -> UserThemeFamily { ( "type".into(), UserHighlightStyle { - color: Some(rgba(0xee5d43ff).into()), + color: Some(rgba(0xffe66dff).into()), ..Default::default() }, ), @@ -404,7 +404,7 @@ pub fn andromeda() -> UserThemeFamily { ( "type".into(), UserHighlightStyle { - color: Some(rgba(0xee5d43ff).into()), + color: Some(rgba(0xffe66dff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 1d6bb1634cf31e3ba744e53b5cb20647bdc4b179..80f1280359798302f5a2da4d200decac01310bc6 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -152,7 +152,7 @@ pub fn ayu() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x55b4d4ff).into()), + color: Some(rgba(0xfa8d3eff).into()), ..Default::default() }, ), @@ -194,14 +194,14 @@ pub fn ayu() -> UserThemeFamily { ( "property".into(), UserHighlightStyle { - color: Some(rgba(0x55b4d4ff).into()), + color: Some(rgba(0xf07171ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x55b4d480).into()), + color: Some(rgba(0x5c6166ff).into()), ..Default::default() }, ), @@ -229,7 +229,7 @@ pub fn ayu() -> UserThemeFamily { ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x55b4d480).into()), + color: Some(rgba(0x5c6166ff).into()), ..Default::default() }, ), @@ -306,7 +306,7 @@ pub fn ayu() -> UserThemeFamily { ( "variable.special".into(), UserHighlightStyle { - color: Some(rgba(0xf2ae49ff).into()), + color: Some(rgba(0xf07171ff).into()), ..Default::default() }, ), @@ -452,7 +452,7 @@ pub fn ayu() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x5ccfe6ff).into()), + color: Some(rgba(0xffad66ff).into()), ..Default::default() }, ), @@ -494,14 +494,14 @@ pub fn ayu() -> UserThemeFamily { ( "property".into(), UserHighlightStyle { - color: Some(rgba(0x5ccfe6ff).into()), + color: Some(rgba(0xf28779ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x5ccfe680).into()), + color: Some(rgba(0xcccac2ff).into()), ..Default::default() }, ), @@ -529,7 +529,7 @@ pub fn ayu() -> UserThemeFamily { ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x5ccfe680).into()), + color: Some(rgba(0xcccac2ff).into()), ..Default::default() }, ), @@ -606,7 +606,7 @@ pub fn ayu() -> UserThemeFamily { ( "variable.special".into(), UserHighlightStyle { - color: Some(rgba(0xffd173ff).into()), + color: Some(rgba(0xf28779ff).into()), ..Default::default() }, ), @@ -752,7 +752,7 @@ pub fn ayu() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x39bae6ff).into()), + color: Some(rgba(0xff8f40ff).into()), ..Default::default() }, ), @@ -794,14 +794,14 @@ pub fn ayu() -> UserThemeFamily { ( "property".into(), UserHighlightStyle { - color: Some(rgba(0x39bae6ff).into()), + color: Some(rgba(0xf07178ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x39bae680).into()), + color: Some(rgba(0xbfbdb6ff).into()), ..Default::default() }, ), @@ -829,7 +829,7 @@ pub fn ayu() -> UserThemeFamily { ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x39bae680).into()), + color: Some(rgba(0xbfbdb6ff).into()), ..Default::default() }, ), @@ -906,7 +906,7 @@ pub fn ayu() -> UserThemeFamily { ( "variable.special".into(), UserHighlightStyle { - color: Some(rgba(0xffb454ff).into()), + color: Some(rgba(0xf07178ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 9e1a2d86e8dc2ccd162c4b4304101b1be03840c0..cebca2a49cf9202971703e73d414ac65a10b480b 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -187,35 +187,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), @@ -473,35 +473,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), @@ -759,35 +759,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), @@ -1045,35 +1045,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), @@ -1331,35 +1331,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), @@ -1617,35 +1617,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index cb4278526dd2a084e85dcd627518b75ef7c928dd..d52bc6ab4e111f918f0a67bb09d9fde34fe974d2 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -125,6 +125,7 @@ pub fn night_owl() -> UserThemeFamily { "function".into(), UserHighlightStyle { color: Some(rgba(0x82aaffff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -160,35 +161,40 @@ pub fn night_owl() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -251,7 +257,7 @@ pub fn night_owl() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xd7dbe0ff).into()), + color: Some(rgba(0xc5e478ff).into()), ..Default::default() }, ), @@ -374,6 +380,7 @@ pub fn night_owl() -> UserThemeFamily { "function".into(), UserHighlightStyle { color: Some(rgba(0x4876d6ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -410,6 +417,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -417,6 +425,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation.bracket".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -424,6 +433,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation.delimiter".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -431,6 +441,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation.list_marker".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -438,6 +449,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation.special".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -500,7 +512,7 @@ pub fn night_owl() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0x403f53ff).into()), + color: Some(rgba(0x4876d6ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/noctis.rs b/crates/theme2/src/themes/noctis.rs index e1497f57aba88b8700c1570c599052f3c25d37cc..f5caf2d4ada6497ca31b3b56c4b71cbc75a64287 100644 --- a/crates/theme2/src/themes/noctis.rs +++ b/crates/theme2/src/themes/noctis.rs @@ -102,7 +102,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -373,7 +373,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -644,7 +644,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x5842ffff).into()), + color: Some(rgba(0xa88c00ff).into()), ..Default::default() }, ), @@ -915,7 +915,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x5842ffff).into()), + color: Some(rgba(0xa88c00ff).into()), ..Default::default() }, ), @@ -1186,7 +1186,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x5842ffff).into()), + color: Some(rgba(0xa88c00ff).into()), ..Default::default() }, ), @@ -1457,7 +1457,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7068b1ff).into()), + color: Some(rgba(0xa88c00ff).into()), ..Default::default() }, ), @@ -1728,7 +1728,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -1999,7 +1999,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -2270,7 +2270,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -2541,7 +2541,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -2812,7 +2812,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index c5634bebcfdaee896c2415f392a8f74a742f2e7b..c149c37120b943b98d25343e340a0c89fd45feed 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -248,7 +248,7 @@ pub fn nord() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xd8dee9ff).into()), + color: Some(rgba(0x81a1c1ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 1cebdc83e222e975c0c3b07fe1c837b6b67f7d0d..e12d8a1f0571f4f808c69d85883eefe164754cba 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -188,35 +188,35 @@ pub fn palenight() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), @@ -279,7 +279,7 @@ pub fn palenight() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xff5572ff).into()), + color: Some(rgba(0xffcb6bff).into()), ..Default::default() }, ), @@ -468,35 +468,35 @@ pub fn palenight() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), @@ -559,7 +559,7 @@ pub fn palenight() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xff5572ff).into()), + color: Some(rgba(0xffcb6bff).into()), ..Default::default() }, ), @@ -748,35 +748,35 @@ pub fn palenight() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), @@ -839,7 +839,7 @@ pub fn palenight() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xff5572ff).into()), + color: Some(rgba(0xffcb6bff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 91b79821c86d228cd375c0ca306564cbe977c77d..b27ef55ea06533d5dd379f5a8b7cfc86a6d4a200 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -111,7 +111,7 @@ pub fn rose_pine() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xebbcbaff).into()), + color: Some(rgba(0x31748fff).into()), ..Default::default() }, ), @@ -153,35 +153,35 @@ pub fn rose_pine() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), @@ -251,7 +251,8 @@ pub fn rose_pine() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xc4a7e7ff).into()), + color: Some(rgba(0xebbcbaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -363,7 +364,7 @@ pub fn rose_pine() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xea9a97ff).into()), + color: Some(rgba(0x3e8fb0ff).into()), ..Default::default() }, ), @@ -405,35 +406,35 @@ pub fn rose_pine() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), @@ -503,7 +504,8 @@ pub fn rose_pine() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xc4a7e7ff).into()), + color: Some(rgba(0xea9a97ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -615,7 +617,7 @@ pub fn rose_pine() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xd7827eff).into()), + color: Some(rgba(0x286983ff).into()), ..Default::default() }, ), @@ -657,35 +659,35 @@ pub fn rose_pine() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), @@ -755,7 +757,8 @@ pub fn rose_pine() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0x907aa9ff).into()), + color: Some(rgba(0xd7827eff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index ae2ad900510bb467020575278615c0e6ebea0da3..a9d7e0699cc9d447a95f1a740d5c76489434cad1 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -103,7 +103,7 @@ pub fn solarized() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xcb4b16ff).into()), + color: Some(rgba(0xb58900ff).into()), ..Default::default() }, ), @@ -145,7 +145,7 @@ pub fn solarized() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x268bd2ff).into()), + color: Some(rgba(0x859900ff).into()), ..Default::default() }, ), @@ -257,14 +257,14 @@ pub fn solarized() -> UserThemeFamily { ( "type".into(), UserHighlightStyle { - color: Some(rgba(0x859900ff).into()), + color: Some(rgba(0xb58900ff).into()), ..Default::default() }, ), ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0x839496ff).into()), + color: Some(rgba(0x268bd2ff).into()), ..Default::default() }, ), @@ -365,7 +365,7 @@ pub fn solarized() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xcb4b16ff).into()), + color: Some(rgba(0xb58900ff).into()), ..Default::default() }, ), @@ -407,7 +407,7 @@ pub fn solarized() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x268bd2ff).into()), + color: Some(rgba(0x859900ff).into()), ..Default::default() }, ), @@ -484,7 +484,7 @@ pub fn solarized() -> UserThemeFamily { ( "type".into(), UserHighlightStyle { - color: Some(rgba(0x859900ff).into()), + color: Some(rgba(0xb58900ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 48d1870147eca75a64b9236d99fa43210c751f33..3d0dbd565134a7894da4263740b1c9f0873b926e 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -221,8 +221,7 @@ pub fn synthwave_84() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xfe4450ff).into()), - font_weight: Some(UserFontWeight(700.0)), + color: Some(rgba(0xff7edbff).into()), ..Default::default() }, ), diff --git a/crates/theme_importer/src/vscode/syntax.rs b/crates/theme_importer/src/vscode/syntax.rs index fb64048431e1b0108b53f245194af6dd75da899f..1a8df535bbb15b3b4a1e68ce1f5a534d4e1fbdc6 100644 --- a/crates/theme_importer/src/vscode/syntax.rs +++ b/crates/theme_importer/src/vscode/syntax.rs @@ -153,11 +153,20 @@ impl ZedSyntaxToken { .map(|scope| scope.as_str()) .collect::>(); + let scopes_to_match = self.to_vscode(); + let number_of_scopes_to_match = scopes_to_match.len(); + let mut matches = 0; - for scope in self.to_vscode() { + for (ix, scope) in scopes_to_match.into_iter().enumerate() { + // Assign each entry a weight that is inversely proportional to its + // position in the list. + // + // Entries towards the front are weighted higher than those towards the end. + let weight = (number_of_scopes_to_match - ix) as u32; + if candidate_scopes.contains(&scope) { - matches += 1; + matches += 1 + weight; } } @@ -210,9 +219,10 @@ impl ZedSyntaxToken { ZedSyntaxToken::Hint => vec![], ZedSyntaxToken::Keyword => vec![ "keyword", + "keyword.other.fn.rust", "keyword.control", "keyword.control.fun", - "keyword.other.fn.rust", + "keyword.control.class", "punctuation.accessor", "entity.name.tag", ],