19
19
public class He.DefaultScheme : SchemeFactory , Object {
20
20
public Scheme generate (Color .CAM16Color accent , bool is_dark , bool is_contrast ) {
21
21
var hue = accent. h;
22
+ var chroma = accent. c;
22
23
23
24
double primary_hue = MathUtils . sanitize_degrees (hue);
24
25
double secondary_hue = MathUtils . sanitize_degrees (hue);
25
26
double tertiary_hue = MathUtils . sanitize_degrees (hue + 60.0 );
26
27
27
- const double PRIMARY = 40.0 ;
28
+ double primary = Math . fmax ( 48 , chroma) ;
28
29
const double SECONDARY = 16.0 ;
29
30
const double TERTIARY = 24.0 ;
30
- const double NEUTRAL = 6 .0 ;
31
+ const double NEUTRAL = 4 .0 ;
31
32
const double NEUTRAL2 = 8.0 ;
32
33
33
34
return Scheme () {
34
35
// _ _ ____ _ _ ___ ____ ____ _
35
36
// |\ | |___ | | | |__/ |__| |
36
37
// | \| |___ |__| | | \ | | |___
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 ),
38
39
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 ),
40
41
surface_fg_variant_hex = Color . hct_to_hex (hue, NEUTRAL , is_dark ? 80.0 : 30.0 ),
41
42
inverse_surface_bg_hex = Color . hct_to_hex (hue, NEUTRAL , is_dark ? 90.0 : 20.0 ),
42
43
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 {
53
54
// ___ ____ _ _ _ ____ ____ _ _
54
55
// |__] |__/ | |\/| |__| |__/ \_/
55
56
// | | \ | | | | | | \ |
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 ),
61
62
62
63
// ____ ____ ____ ____ _ _ ___ ____ ____ _ _
63
64
// [__ |___ | | | |\ | | \ |__| |__/ \_/
0 commit comments