Skip to content

Commit 158084b

Browse files
committed
Fix: Default Scheme had bad contrast
1 parent f1d2630 commit 158084b

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

lib/Models/Schemes/Default.vala

+10-9
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,25 @@
1919
public class He.DefaultScheme : SchemeFactory, Object {
2020
public Scheme generate (Color.CAM16Color accent, bool is_dark, bool is_contrast) {
2121
var hue = accent.h;
22+
var chroma = accent.c;
2223

2324
double primary_hue = MathUtils.sanitize_degrees (hue);
2425
double secondary_hue = MathUtils.sanitize_degrees (hue);
2526
double tertiary_hue = MathUtils.sanitize_degrees (hue + 60.0);
2627

27-
const double PRIMARY = 40.0;
28+
double primary = Math.fmax (48, chroma);
2829
const double SECONDARY = 16.0;
2930
const double TERTIARY = 24.0;
30-
const double NEUTRAL = 6.0;
31+
const double NEUTRAL = 4.0;
3132
const double NEUTRAL2 = 8.0;
3233

3334
return Scheme () {
3435
// _ _ ____ _ _ ___ ____ ____ _
3536
// |\ | |___ | | | |__/ |__| |
3637
// | \| |___ |__| | | \ | | |___
37-
surface_bg_hex = Color.hct_to_hex (hue, NEUTRAL, is_dark ? 6.0 : 98.0),
38+
surface_bg_hex = Color.hct_to_hex (hue, NEUTRAL, is_dark ? 6.0 : 99.0),
3839
surface_bg_variant_hex = Color.hct_to_hex (hue, NEUTRAL, is_dark ? 24.0 : 90.0),
39-
surface_fg_hex = Color.hct_to_hex (hue, NEUTRAL, is_dark ? 98.0 : 10.0),
40+
surface_fg_hex = Color.hct_to_hex (hue, NEUTRAL, is_dark ? 99.0 : 10.0),
4041
surface_fg_variant_hex = Color.hct_to_hex (hue, NEUTRAL, is_dark ? 80.0 : 30.0),
4142
inverse_surface_bg_hex = Color.hct_to_hex (hue, NEUTRAL, is_dark ? 90.0 : 20.0),
4243
inverse_surface_fg_hex = Color.hct_to_hex (hue, NEUTRAL, is_dark ? 20.0 : 95.0),
@@ -53,11 +54,11 @@ public class He.DefaultScheme : SchemeFactory, Object {
5354
// ___ ____ _ _ _ ____ ____ _ _
5455
// |__] |__/ | |\/| |__| |__/ \_/
5556
// | | \ | | | | | | \ |
56-
primary_hex = Color.hct_to_hex (primary_hue, PRIMARY, is_dark ? is_contrast ? 90.0 : 80.0 : is_contrast ? 20.0 : 40.0),
57-
on_primary_hex = Color.hct_to_hex (primary_hue, PRIMARY, is_dark ? 20.0 : 100.0),
58-
primary_container_hex = Color.hct_to_hex (primary_hue, PRIMARY, is_dark ? is_contrast ? 40.0 : 30.0 : is_contrast ? 70.0 : 90.0),
59-
on_primary_container_hex = Color.hct_to_hex (primary_hue, PRIMARY, is_dark ? 90.0 : 10.0),
60-
inverse_primary_hex = Color.hct_to_hex (primary_hue, PRIMARY, is_dark ? 40.0 : 80.0),
57+
primary_hex = Color.hct_to_hex (primary_hue, primary, is_dark ? is_contrast ? 90.0 : 80.0 : is_contrast ? 20.0 : 40.0),
58+
on_primary_hex = Color.hct_to_hex (primary_hue, primary, is_dark ? 20.0 : 100.0),
59+
primary_container_hex = Color.hct_to_hex (primary_hue, primary, is_dark ? is_contrast ? 40.0 : 30.0 : is_contrast ? 70.0 : 90.0),
60+
on_primary_container_hex = Color.hct_to_hex (primary_hue, primary, is_dark ? 90.0 : 10.0),
61+
inverse_primary_hex = Color.hct_to_hex (primary_hue, primary, is_dark ? 40.0 : 80.0),
6162

6263
// ____ ____ ____ ____ _ _ ___ ____ ____ _ _
6364
// [__ |___ | | | |\ | | \ |__| |__/ \_/

lib/Models/StyleManager.vala

+2-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ public class He.StyleManager : Object {
298298
border-radius: $circle_roundness;
299299
}
300300
301-
.view-switcher button.toggle {
301+
.view-switcher button.toggle,
302+
.bottom-bar {
302303
border-radius: 0px;
303304
}
304305
.badge,
@@ -323,7 +324,6 @@ public class He.StyleManager : Object {
323324
}
324325
.content-block,
325326
.mini-content-block,
326-
.bottom-bar,
327327
.dialog-content,
328328
.switchbar,
329329
.navigation-section-list row .mini-content-block,

0 commit comments

Comments
 (0)