|
19 | 19 | import androidx.annotation.NonNull; |
20 | 20 | import dislike.DislikeAnalyzer; |
21 | 21 | import hct.Hct; |
| 22 | +import java.util.Arrays; |
| 23 | +import java.util.List; |
| 24 | +import java.util.function.Supplier; |
22 | 25 |
|
23 | 26 | /** Named colors, otherwise known as tokens, or roles, in the Material Design system. */ |
24 | 27 | // Prevent lint for Function.apply not being available on Android before API level 14 (4.0.1). |
@@ -933,6 +936,73 @@ public DynamicColor textHintInverse() { |
933 | 936 | "text_hint_inverse", (s) -> s.neutralPalette, (s) -> s.isDark ? 10.0 : 90.0); |
934 | 937 | } |
935 | 938 |
|
| 939 | + /** All dynamic colors in Material Design system. */ |
| 940 | + public final List<Supplier<DynamicColor>> allDynamicColors() { |
| 941 | + return Arrays.asList( |
| 942 | + this::primaryPaletteKeyColor, |
| 943 | + this::secondaryPaletteKeyColor, |
| 944 | + this::tertiaryPaletteKeyColor, |
| 945 | + this::neutralPaletteKeyColor, |
| 946 | + this::neutralVariantPaletteKeyColor, |
| 947 | + this::background, |
| 948 | + this::onBackground, |
| 949 | + this::surface, |
| 950 | + this::surfaceDim, |
| 951 | + this::surfaceBright, |
| 952 | + this::surfaceContainerLowest, |
| 953 | + this::surfaceContainerLow, |
| 954 | + this::surfaceContainer, |
| 955 | + this::surfaceContainerHigh, |
| 956 | + this::surfaceContainerHighest, |
| 957 | + this::onSurface, |
| 958 | + this::surfaceVariant, |
| 959 | + this::onSurfaceVariant, |
| 960 | + this::inverseSurface, |
| 961 | + this::inverseOnSurface, |
| 962 | + this::outline, |
| 963 | + this::outlineVariant, |
| 964 | + this::shadow, |
| 965 | + this::scrim, |
| 966 | + this::surfaceTint, |
| 967 | + this::primary, |
| 968 | + this::onPrimary, |
| 969 | + this::primaryContainer, |
| 970 | + this::onPrimaryContainer, |
| 971 | + this::inversePrimary, |
| 972 | + this::secondary, |
| 973 | + this::onSecondary, |
| 974 | + this::secondaryContainer, |
| 975 | + this::onSecondaryContainer, |
| 976 | + this::tertiary, |
| 977 | + this::onTertiary, |
| 978 | + this::tertiaryContainer, |
| 979 | + this::onTertiaryContainer, |
| 980 | + this::error, |
| 981 | + this::onError, |
| 982 | + this::errorContainer, |
| 983 | + this::onErrorContainer, |
| 984 | + this::primaryFixed, |
| 985 | + this::primaryFixedDim, |
| 986 | + this::onPrimaryFixed, |
| 987 | + this::onPrimaryFixedVariant, |
| 988 | + this::secondaryFixed, |
| 989 | + this::secondaryFixedDim, |
| 990 | + this::onSecondaryFixed, |
| 991 | + this::onSecondaryFixedVariant, |
| 992 | + this::tertiaryFixed, |
| 993 | + this::tertiaryFixedDim, |
| 994 | + this::onTertiaryFixed, |
| 995 | + this::onTertiaryFixedVariant, |
| 996 | + this::controlActivated, |
| 997 | + this::controlNormal, |
| 998 | + this::controlHighlight, |
| 999 | + this::textPrimaryInverse, |
| 1000 | + this::textSecondaryAndTertiaryInverse, |
| 1001 | + this::textPrimaryInverseDisableOnly, |
| 1002 | + this::textSecondaryAndTertiaryInverseDisabled, |
| 1003 | + this::textHintInverse); |
| 1004 | + } |
| 1005 | + |
936 | 1006 | private boolean isFidelity(DynamicScheme scheme) { |
937 | 1007 | if (this.isExtendedFidelity |
938 | 1008 | && scheme.variant != Variant.MONOCHROME |
|
0 commit comments