1
- @use ' sass:color' ;
2
1
@use ' sass:map' ;
3
- @use ' sass:math' ;
4
-
5
- /// Estimate a hue using the given previous and next hues.
6
- @function _estimate-hue ($hues , $hue , $prev-hue , $next-hue ) {
7
- $weight : math .div ($next-hue - $hue , $next-hue - $prev-hue ) * 100% ;
8
- @return color .mix (map .get ($hues , $prev-hue ), map .get ($hues , $next-hue ), $weight );
9
- }
10
-
11
- // TODO(mmalerba): Remove this and add correct values for these hues.
12
- /// The Material Design spec references some neutral hues that are not generated by
13
- /// https://m3.material.io/theme-builder. For now we use this function to estimate the missing hues
14
- /// by blending the nearest hues that are generated.
15
- /// Note: when updating, the corresponding logic in the theme generation schematic should be
16
- /// updated as well. See `src/material/schematics/ng-generate/m3-theme/index.ts#patchMissingHues`
17
- @function _patch-missing-hues ($palette ) {
18
- $neutral : map .get ($palette , neutral );
19
- $palette : map .set ($palette , neutral , 4 , _estimate-hue ($neutral , 4 , 0 , 10 ));
20
- $palette : map .set ($palette , neutral , 6 , _estimate-hue ($neutral , 6 , 0 , 10 ));
21
- $palette : map .set ($palette , neutral , 12 , _estimate-hue ($neutral , 12 , 10 , 20 ));
22
- $palette : map .set ($palette , neutral , 17 , _estimate-hue ($neutral , 17 , 10 , 20 ));
23
- $palette : map .set ($palette , neutral , 22 , _estimate-hue ($neutral , 22 , 20 , 25 ));
24
- $palette : map .set ($palette , neutral , 24 , _estimate-hue ($neutral , 24 , 20 , 25 ));
25
- $palette : map .set ($palette , neutral , 87 , _estimate-hue ($neutral , 87 , 80 , 90 ));
26
- $palette : map .set ($palette , neutral , 92 , _estimate-hue ($neutral , 92 , 90 , 95 ));
27
- $palette : map .set ($palette , neutral , 94 , _estimate-hue ($neutral , 94 , 90 , 95 ));
28
- $palette : map .set ($palette , neutral , 96 , _estimate-hue ($neutral , 96 , 95 , 98 ));
29
- @return $palette ;
30
- }
31
2
32
3
/// Adds the error colors to the given palette.
33
4
@function _patch-error-palette ($palette ) {
56
27
);
57
28
}
58
29
59
- @function _apply-patches ($palette ) {
60
- @return _patch-missing-hues (_patch-error-palette ($palette ));
61
- }
62
-
63
30
/// Red color palette to be used as primary or tertiary palette.
64
- $red-palette : _apply-patches ((
31
+ $red-palette : _patch-error-palette ((
65
32
0 : #000000 ,
66
33
10 : #410000 ,
67
34
20 : #690100 ,
@@ -113,6 +80,16 @@ $red-palette: _apply-patches((
113
80
98 : #fff8f6 ,
114
81
99 : #fffbff ,
115
82
100 : #ffffff ,
83
+ 4 : #130d0c ,
84
+ 6 : #181211 ,
85
+ 12 : #251e1d ,
86
+ 17 : #302828 ,
87
+ 22 : #3b3332 ,
88
+ 24 : #3f3737 ,
89
+ 87 : #e4d7d6 ,
90
+ 92 : #f3e5e4 ,
91
+ 94 : #f9ebe9 ,
92
+ 96 : #fef1ef ,
116
93
),
117
94
neutral- variant: (
118
95
0 : #000000 ,
@@ -135,7 +112,7 @@ $red-palette: _apply-patches((
135
112
));
136
113
137
114
/// Green color palette to be used as primary or tertiary palette.
138
- $green-palette : _apply-patches ((
115
+ $green-palette : _patch-error-palette ((
139
116
0 : #000000 ,
140
117
10 : #002200 ,
141
118
20 : #013a00 ,
@@ -187,6 +164,16 @@ $green-palette: _apply-patches((
187
164
98 : #f9faf3 ,
188
165
99 : #fcfdf6 ,
189
166
100 : #ffffff ,
167
+ 4 : #0c0f0b ,
168
+ 6 : #121410 ,
169
+ 12 : #1e201c ,
170
+ 17 : #282b26 ,
171
+ 22 : #333531 ,
172
+ 24 : #383a35 ,
173
+ 87 : #dadbd3 ,
174
+ 92 : #e8e9e1 ,
175
+ 94 : #eeeee7 ,
176
+ 96 : #f3f4ed ,
190
177
),
191
178
neutral- variant: (
192
179
0 : #000000 ,
@@ -209,7 +196,7 @@ $green-palette: _apply-patches((
209
196
));
210
197
211
198
/// Blue color palette to be used as primary or tertiary palette.
212
- $blue-palette : _apply-patches ((
199
+ $blue-palette : _patch-error-palette ((
213
200
0 : #000000 ,
214
201
10 : #00006e ,
215
202
20 : #0001ac ,
@@ -261,6 +248,16 @@ $blue-palette: _apply-patches((
261
248
98 : #fcf8fd ,
262
249
99 : #fffbff ,
263
250
100 : #ffffff ,
251
+ 4 : #0e0e11 ,
252
+ 6 : #131316 ,
253
+ 12 : #201f22 ,
254
+ 17 : #2a292d ,
255
+ 22 : #353438 ,
256
+ 24 : #3a393c ,
257
+ 87 : #dcd9dd ,
258
+ 92 : #ebe7eb ,
259
+ 94 : #f0edf1 ,
260
+ 96 : #f6f2f7 ,
264
261
),
265
262
neutral- variant: (
266
263
0 : #000000 ,
@@ -283,7 +280,7 @@ $blue-palette: _apply-patches((
283
280
));
284
281
285
282
/// Yellow color palette to be used as primary or tertiary palette.
286
- $yellow-palette : _apply-patches ((
283
+ $yellow-palette : _patch-error-palette ((
287
284
0 : #000000 ,
288
285
10 : #1d1d00 ,
289
286
20 : #323200 ,
@@ -335,6 +332,16 @@ $yellow-palette: _apply-patches((
335
332
98 : #fdf9f0 ,
336
333
99 : #fffbff ,
337
334
100 : #ffffff ,
335
+ 4 : #0f0e0a ,
336
+ 6 : #14140f ,
337
+ 12 : #20201b ,
338
+ 17 : #2b2a25 ,
339
+ 22 : #36352f ,
340
+ 24 : #3a3933 ,
341
+ 87 : #dddad1 ,
342
+ 92 : #ece8df ,
343
+ 94 : #f1ede5 ,
344
+ 96 : #f7f3ea ,
338
345
),
339
346
neutral- variant: (
340
347
0 : #000000 ,
@@ -357,7 +364,7 @@ $yellow-palette: _apply-patches((
357
364
));
358
365
359
366
/// Cyan color palette to be used as primary or tertiary palette.
360
- $cyan-palette : _apply-patches ((
367
+ $cyan-palette : _patch-error-palette ((
361
368
0 : #000000 ,
362
369
10 : #002020 ,
363
370
20 : #003737 ,
@@ -409,6 +416,16 @@ $cyan-palette: _apply-patches((
409
416
98 : #f7faf9 ,
410
417
99 : #fafdfc ,
411
418
100 : #ffffff ,
419
+ 4 : #0b0f0e ,
420
+ 6 : #101414 ,
421
+ 12 : #1c2020 ,
422
+ 17 : #272b2a ,
423
+ 22 : #313635 ,
424
+ 24 : #363a39 ,
425
+ 87 : #d7dbd9 ,
426
+ 92 : #e6e9e7 ,
427
+ 94 : #ebefed ,
428
+ 96 : #f1f4f3 ,
412
429
),
413
430
neutral- variant: (
414
431
0 : #000000 ,
@@ -431,7 +448,7 @@ $cyan-palette: _apply-patches((
431
448
));
432
449
433
450
/// Magenta color palette to be used as primary or tertiary palette.
434
- $magenta-palette : _apply-patches ((
451
+ $magenta-palette : _patch-error-palette ((
435
452
0 : #000000 ,
436
453
10 : #380038 ,
437
454
20 : #5b005b ,
@@ -483,6 +500,16 @@ $magenta-palette: _apply-patches((
483
500
98 : #fff7f9 ,
484
501
99 : #fffbff ,
485
502
100 : #ffffff ,
503
+ 4 : #110d10 ,
504
+ 6 : #161215 ,
505
+ 12 : #231e22 ,
506
+ 17 : #2d292c ,
507
+ 22 : #383337 ,
508
+ 24 : #3d383b ,
509
+ 87 : #e1d7dc ,
510
+ 92 : #efe6ea ,
511
+ 94 : #f5ebf0 ,
512
+ 96 : #fbf1f5 ,
486
513
),
487
514
neutral- variant: (
488
515
0 : #000000 ,
@@ -505,7 +532,7 @@ $magenta-palette: _apply-patches((
505
532
));
506
533
507
534
/// Orange color palette to be used as primary or tertiary palette.
508
- $orange-palette : _apply-patches ((
535
+ $orange-palette : _patch-error-palette ((
509
536
0 : #000000 ,
510
537
10 : #311300 ,
511
538
20 : #502400 ,
@@ -557,6 +584,16 @@ $orange-palette: _apply-patches((
557
584
98 : #fff8f5 ,
558
585
99 : #fffbff ,
559
586
100 : #ffffff ,
587
+ 4 : #120d0b ,
588
+ 6 : #181210 ,
589
+ 12 : #241e1b ,
590
+ 17 : #2f2926 ,
591
+ 22 : #3a3330 ,
592
+ 24 : #3f3834 ,
593
+ 87 : #e3d8d3 ,
594
+ 92 : #f2e6e1 ,
595
+ 94 : #f8ebe6 ,
596
+ 96 : #fef1ec ,
560
597
),
561
598
neutral- variant: (
562
599
0 : #000000 ,
@@ -579,7 +616,7 @@ $orange-palette: _apply-patches((
579
616
));
580
617
581
618
/// Chartreuse color palette to be used as primary or tertiary palette.
582
- $chartreuse-palette : _apply-patches ((
619
+ $chartreuse-palette : _patch-error-palette ((
583
620
0 : #000000 ,
584
621
10 : #0b2000 ,
585
622
20 : #173800 ,
@@ -631,6 +668,16 @@ $chartreuse-palette: _apply-patches((
631
668
98 : #fafaf2 ,
632
669
99 : #fdfdf5 ,
633
670
100 : #ffffff ,
671
+ 4 : #0c0f0b ,
672
+ 6 : #121410 ,
673
+ 12 : #1e201c ,
674
+ 17 : #282b26 ,
675
+ 22 : #333531 ,
676
+ 24 : #383a35 ,
677
+ 87 : #dadbd3 ,
678
+ 92 : #e8e9e1 ,
679
+ 94 : #eeeee7 ,
680
+ 96 : #f3f4ed ,
634
681
),
635
682
neutral- variant: (
636
683
0 : #000000 ,
@@ -653,7 +700,7 @@ $chartreuse-palette: _apply-patches((
653
700
));
654
701
655
702
/// Spring Green color palette to be used as primary or tertiary palette.
656
- $spring-green-palette : _apply-patches ((
703
+ $spring-green-palette : _patch-error-palette ((
657
704
0 : #000000 ,
658
705
10 : #00210b ,
659
706
20 : #003917 ,
@@ -705,6 +752,16 @@ $spring-green-palette: _apply-patches((
705
752
98 : #f9faf4 ,
706
753
99 : #fcfdf7 ,
707
754
100 : #ffffff ,
755
+ 4 : #0c0f0c ,
756
+ 6 : #111411 ,
757
+ 12 : #1d201d ,
758
+ 17 : #282b27 ,
759
+ 22 : #323632 ,
760
+ 24 : #373a36 ,
761
+ 87 : #d9dbd5 ,
762
+ 92 : #e7e9e3 ,
763
+ 94 : #edefe8 ,
764
+ 96 : #f2f4ee ,
708
765
),
709
766
neutral- variant: (
710
767
0 : #000000 ,
@@ -727,7 +784,7 @@ $spring-green-palette: _apply-patches((
727
784
));
728
785
729
786
/// Azure color palette to be used as primary or tertiary palette.
730
- $azure-palette : _apply-patches ((
787
+ $azure-palette : _patch-error-palette ((
731
788
0 : #000000 ,
732
789
10 : #001b3f ,
733
790
20 : #002f65 ,
@@ -779,6 +836,16 @@ $azure-palette: _apply-patches((
779
836
98 : #faf9fd ,
780
837
99 : #fdfbff ,
781
838
100 : #ffffff ,
839
+ 4 : #0d0e11 ,
840
+ 6 : #121316 ,
841
+ 12 : #1f2022 ,
842
+ 17 : #292a2c ,
843
+ 22 : #343537 ,
844
+ 24 : #38393c ,
845
+ 87 : #dbd9dd ,
846
+ 92 : #e9e7eb ,
847
+ 94 : #efedf0 ,
848
+ 96 : #f4f3f6 ,
782
849
),
783
850
neutral- variant: (
784
851
0 : #000000 ,
@@ -801,7 +868,7 @@ $azure-palette: _apply-patches((
801
868
));
802
869
803
870
/// Violet color palette to be used as primary or tertiary palette.
804
- $violet-palette : _apply-patches ((
871
+ $violet-palette : _patch-error-palette ((
805
872
0 : #000000 ,
806
873
10 : #270057 ,
807
874
20 : #42008a ,
@@ -853,6 +920,16 @@ $violet-palette: _apply-patches((
853
920
98 : #fef8fc ,
854
921
99 : #fffbff ,
855
922
100 : #ffffff ,
923
+ 4 : #0f0d11 ,
924
+ 6 : #151316 ,
925
+ 12 : #211f22 ,
926
+ 17 : #2b292d ,
927
+ 22 : #363437 ,
928
+ 24 : #3b383c ,
929
+ 87 : #ded8dd ,
930
+ 92 : #ede6eb ,
931
+ 94 : #f2ecf1 ,
932
+ 96 : #f8f2f6 ,
856
933
),
857
934
neutral- variant: (
858
935
0 : #000000 ,
@@ -875,7 +952,7 @@ $violet-palette: _apply-patches((
875
952
));
876
953
877
954
/// Rose color palette to be used as primary or tertiary palette.
878
- $rose-palette : _apply-patches ((
955
+ $rose-palette : _patch-error-palette ((
879
956
0 : #000000 ,
880
957
10 : #3f001b ,
881
958
20 : #65002f ,
@@ -927,6 +1004,16 @@ $rose-palette: _apply-patches((
927
1004
98 : #fff8f8 ,
928
1005
99 : #fffbff ,
929
1006
100 : #ffffff ,
1007
+ 4 : #120d0e ,
1008
+ 6 : #171213 ,
1009
+ 12 : #241e1f ,
1010
+ 17 : #2f2829 ,
1011
+ 22 : #3a3334 ,
1012
+ 24 : #3e3738 ,
1013
+ 87 : #e3d7d8 ,
1014
+ 92 : #f1e5e6 ,
1015
+ 94 : #f7ebec ,
1016
+ 96 : #fdf1f2 ,
930
1017
),
931
1018
neutral- variant: (
932
1019
0 : #000000 ,
0 commit comments