Skip to content

Commit 5e534d6

Browse files
feat: Bump to 7th May 2025 codebase
Signed-off-by: Andy Scherzinger <[email protected]>
1 parent 66f8580 commit 5e534d6

20 files changed

+4677
-1056
lines changed
Lines changed: 318 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,318 @@
1+
/*
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package dynamiccolor;
18+
19+
import androidx.annotation.NonNull;
20+
import androidx.annotation.Nullable;
21+
import dynamiccolor.DynamicScheme.Platform;
22+
import hct.Hct;
23+
import palettes.TonalPalette;
24+
import java.util.Optional;
25+
26+
/** An interface defining all the necessary methods that could be different between specs. */
27+
public interface ColorSpec {
28+
29+
/** All available spec versions. */
30+
public enum SpecVersion {
31+
SPEC_2021,
32+
SPEC_2025,
33+
}
34+
35+
////////////////////////////////////////////////////////////////
36+
// Main Palettes //
37+
////////////////////////////////////////////////////////////////
38+
39+
@NonNull
40+
public DynamicColor primaryPaletteKeyColor();
41+
42+
@NonNull
43+
public DynamicColor secondaryPaletteKeyColor();
44+
45+
@NonNull
46+
public DynamicColor tertiaryPaletteKeyColor();
47+
48+
@NonNull
49+
public DynamicColor neutralPaletteKeyColor();
50+
51+
@NonNull
52+
public DynamicColor neutralVariantPaletteKeyColor();
53+
54+
@NonNull
55+
public DynamicColor errorPaletteKeyColor();
56+
57+
////////////////////////////////////////////////////////////////
58+
// Surfaces [S] //
59+
////////////////////////////////////////////////////////////////
60+
61+
@NonNull
62+
public DynamicColor background();
63+
64+
@NonNull
65+
public DynamicColor onBackground();
66+
67+
@NonNull
68+
public DynamicColor surface();
69+
70+
@NonNull
71+
public DynamicColor surfaceDim();
72+
73+
@NonNull
74+
public DynamicColor surfaceBright();
75+
76+
@NonNull
77+
public DynamicColor surfaceContainerLowest();
78+
79+
@NonNull
80+
public DynamicColor surfaceContainerLow();
81+
82+
@NonNull
83+
public DynamicColor surfaceContainer();
84+
85+
@NonNull
86+
public DynamicColor surfaceContainerHigh();
87+
88+
@NonNull
89+
public DynamicColor surfaceContainerHighest();
90+
91+
@NonNull
92+
public DynamicColor onSurface();
93+
94+
@NonNull
95+
public DynamicColor surfaceVariant();
96+
97+
@NonNull
98+
public DynamicColor onSurfaceVariant();
99+
100+
@NonNull
101+
public DynamicColor inverseSurface();
102+
103+
@NonNull
104+
public DynamicColor inverseOnSurface();
105+
106+
@NonNull
107+
public DynamicColor outline();
108+
109+
@NonNull
110+
public DynamicColor outlineVariant();
111+
112+
@NonNull
113+
public DynamicColor shadow();
114+
115+
@NonNull
116+
public DynamicColor scrim();
117+
118+
@NonNull
119+
public DynamicColor surfaceTint();
120+
121+
////////////////////////////////////////////////////////////////
122+
// Primaries [P] //
123+
////////////////////////////////////////////////////////////////
124+
125+
@NonNull
126+
public DynamicColor primary();
127+
128+
@Nullable
129+
public DynamicColor primaryDim();
130+
131+
@NonNull
132+
public DynamicColor onPrimary();
133+
134+
@NonNull
135+
public DynamicColor primaryContainer();
136+
137+
@NonNull
138+
public DynamicColor onPrimaryContainer();
139+
140+
@NonNull
141+
public DynamicColor inversePrimary();
142+
143+
////////////////////////////////////////////////////////////////
144+
// Secondaries [Q] //
145+
////////////////////////////////////////////////////////////////
146+
147+
@NonNull
148+
public DynamicColor secondary();
149+
150+
@Nullable
151+
public DynamicColor secondaryDim();
152+
153+
@NonNull
154+
public DynamicColor onSecondary();
155+
156+
@NonNull
157+
public DynamicColor secondaryContainer();
158+
159+
@NonNull
160+
public DynamicColor onSecondaryContainer();
161+
162+
////////////////////////////////////////////////////////////////
163+
// Tertiaries [T] //
164+
////////////////////////////////////////////////////////////////
165+
166+
@NonNull
167+
public DynamicColor tertiary();
168+
169+
@Nullable
170+
public DynamicColor tertiaryDim();
171+
172+
@NonNull
173+
public DynamicColor onTertiary();
174+
175+
@NonNull
176+
public DynamicColor tertiaryContainer();
177+
178+
@NonNull
179+
public DynamicColor onTertiaryContainer();
180+
181+
////////////////////////////////////////////////////////////////
182+
// Errors [E] //
183+
////////////////////////////////////////////////////////////////
184+
185+
@NonNull
186+
public DynamicColor error();
187+
188+
@Nullable
189+
public DynamicColor errorDim();
190+
191+
@NonNull
192+
public DynamicColor onError();
193+
194+
@NonNull
195+
public DynamicColor errorContainer();
196+
197+
@NonNull
198+
public DynamicColor onErrorContainer();
199+
200+
////////////////////////////////////////////////////////////////
201+
// Primary Fixed Colors [PF] //
202+
////////////////////////////////////////////////////////////////
203+
204+
@NonNull
205+
public DynamicColor primaryFixed();
206+
207+
@NonNull
208+
public DynamicColor primaryFixedDim();
209+
210+
@NonNull
211+
public DynamicColor onPrimaryFixed();
212+
213+
@NonNull
214+
public DynamicColor onPrimaryFixedVariant();
215+
216+
////////////////////////////////////////////////////////////////
217+
// Secondary Fixed Colors [QF] //
218+
////////////////////////////////////////////////////////////////
219+
220+
@NonNull
221+
public DynamicColor secondaryFixed();
222+
223+
@NonNull
224+
public DynamicColor secondaryFixedDim();
225+
226+
@NonNull
227+
public DynamicColor onSecondaryFixed();
228+
229+
@NonNull
230+
public DynamicColor onSecondaryFixedVariant();
231+
232+
////////////////////////////////////////////////////////////////
233+
// Tertiary Fixed Colors [TF] //
234+
////////////////////////////////////////////////////////////////
235+
236+
@NonNull
237+
public DynamicColor tertiaryFixed();
238+
239+
@NonNull
240+
public DynamicColor tertiaryFixedDim();
241+
242+
@NonNull
243+
public DynamicColor onTertiaryFixed();
244+
245+
@NonNull
246+
public DynamicColor onTertiaryFixedVariant();
247+
248+
//////////////////////////////////////////////////////////////////
249+
// Android-only Colors //
250+
//////////////////////////////////////////////////////////////////
251+
252+
@NonNull
253+
public DynamicColor controlActivated();
254+
255+
@NonNull
256+
public DynamicColor controlNormal();
257+
258+
@NonNull
259+
public DynamicColor controlHighlight();
260+
261+
@NonNull
262+
public DynamicColor textPrimaryInverse();
263+
264+
@NonNull
265+
public DynamicColor textSecondaryAndTertiaryInverse();
266+
267+
@NonNull
268+
public DynamicColor textPrimaryInverseDisableOnly();
269+
270+
@NonNull
271+
public DynamicColor textSecondaryAndTertiaryInverseDisabled();
272+
273+
@NonNull
274+
public DynamicColor textHintInverse();
275+
276+
////////////////////////////////////////////////////////////////
277+
// Other //
278+
////////////////////////////////////////////////////////////////
279+
280+
@NonNull
281+
public DynamicColor highestSurface(@NonNull DynamicScheme s);
282+
283+
/////////////////////////////////////////////////////////////////
284+
// Color value calculations //
285+
/////////////////////////////////////////////////////////////////
286+
287+
Hct getHct(DynamicScheme scheme, DynamicColor color);
288+
289+
double getTone(DynamicScheme scheme, DynamicColor color);
290+
291+
//////////////////////////////////////////////////////////////////
292+
// Scheme Palettes //
293+
//////////////////////////////////////////////////////////////////
294+
295+
@NonNull
296+
public TonalPalette getPrimaryPalette(
297+
Variant variant, Hct sourceColorHct, boolean isDark, Platform platform, double contrastLevel);
298+
299+
@NonNull
300+
public TonalPalette getSecondaryPalette(
301+
Variant variant, Hct sourceColorHct, boolean isDark, Platform platform, double contrastLevel);
302+
303+
@NonNull
304+
public TonalPalette getTertiaryPalette(
305+
Variant variant, Hct sourceColorHct, boolean isDark, Platform platform, double contrastLevel);
306+
307+
@NonNull
308+
public TonalPalette getNeutralPalette(
309+
Variant variant, Hct sourceColorHct, boolean isDark, Platform platform, double contrastLevel);
310+
311+
@NonNull
312+
public TonalPalette getNeutralVariantPalette(
313+
Variant variant, Hct sourceColorHct, boolean isDark, Platform platform, double contrastLevel);
314+
315+
@NonNull
316+
public Optional<TonalPalette> getErrorPalette(
317+
Variant variant, Hct sourceColorHct, boolean isDark, Platform platform, double contrastLevel);
318+
}

0 commit comments

Comments
 (0)