1 /*
2  * Copyright 2024 The Android Open Source Project
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 package androidx.wear.protolayout.material3
17 
18 import androidx.wear.protolayout.material3.tokens.ColorTokens
19 import androidx.wear.protolayout.types.LayoutColor
20 import androidx.wear.protolayout.types.argb
21 
22 /**
23  * A [ColorScheme] holds all the named color parameters for a [MaterialTheme].
24  *
25  * Color schemes are designed to be harmonious, ensure accessible text, and distinguish UI elements
26  * and surfaces from one another.
27  *
28  * The Material color system and custom schemes provide default values for color as a starting point
29  * for customization.
30  *
31  * To learn more about color schemes, see
32  * [Material Design Color System](https://m3.material.io/styles/color/the-color-system/color-roles).
33  *
34  * @property primary is the color displayed most frequently across your app’s screens and components
35  * @property primaryDim is less prominent than [primary] for component backgrounds
36  * @property primaryContainer is a standout container color for key components
37  * @property onPrimary color is used for text and icons displayed on top of the primary color
38  * @property onPrimaryContainer color (and state variants) that should be used for content on top of
39  *   [primaryContainer]
40  * @property secondary color provides more ways to accent and distinguish your product
41  * @property secondaryDim is less prominent than [secondary] for component backgrounds
42  * @property secondaryContainer is a tonal color to be used in containers
43  * @property onSecondary color is used for text and icons displayed on top of the secondary color
44  * @property onSecondaryContainer color (and state variants) should be used for content on top of
45  *   [secondaryContainer]
46  * @property tertiary color that can be used to balance primary and secondary colors, or bring
47  *   heightened attention to an element
48  * @property tertiaryDim is a less prominent tertiary color that can be used to balance primary and
49  *   secondary colors, or bring heightened attention to an element
50  * @property tertiaryContainer is a tonal color to be used in containers
51  * @property onTertiary color is used for text and icons displayed on top of the tertiary color
52  * @property onTertiaryContainer color (and state variants) that should be used for content on top
53  *   of [tertiaryContainer]
54  * @property surfaceContainerLow is a surface color used for large containment components such as
55  *   Card and Button with low prominence
56  * @property surfaceContainer is the main surface color that affect surfaces of components with
57  *   large containment areas, such as Card and Button
58  * @property surfaceContainerHigh is a surface color used for large containment components such Card
59  *   and Button with high prominence
60  * @property onSurface color is used for text and icons displayed on top of the surface color
61  * @property onSurfaceVariant is the color for secondary text and icons on top of [surfaceContainer]
62  * @property outline is the main color for primary outline components. The outline color role adds
63  *   contrast for accessibility purposes.
64  * @property outlineVariant is the secondary color for secondary outline components
65  * @property background color that appears behind other content
66  * @property onBackground color is used for text and icons displayed on top of the background color
67  * @property error color that indicates remove, delete, close or dismiss actions. Added as a
68  *   slightly less alarming and urgent alternative to errorContainer than the errorDim color
69  * @property errorDim color that indicates high priority errors or emergency actions, such as safety
70  *   alerts
71  * @property errorContainer is color that indicates errors or emergency actions, such as safety
72  *   alerts. This color is for use-cases that are more alarming and urgent than the error color.
73  * @property onError color is used for text and icons displayed on top of the error color
74  * @property onErrorContainer is color used for text and icons on the errorContainer color
75  */
76 public class ColorScheme(
77     public val primary: LayoutColor = ColorTokens.PRIMARY.argb,
78     public val primaryDim: LayoutColor = ColorTokens.PRIMARY_DIM.argb,
79     public val primaryContainer: LayoutColor = ColorTokens.PRIMARY_CONTAINER.argb,
80     public val onPrimary: LayoutColor = ColorTokens.ON_PRIMARY.argb,
81     public val onPrimaryContainer: LayoutColor = ColorTokens.ON_PRIMARY_CONTAINER.argb,
82     public val secondary: LayoutColor = ColorTokens.SECONDARY.argb,
83     public val secondaryDim: LayoutColor = ColorTokens.SECONDARY_DIM.argb,
84     public val secondaryContainer: LayoutColor = ColorTokens.SECONDARY_CONTAINER.argb,
85     public val onSecondary: LayoutColor = ColorTokens.ON_SECONDARY.argb,
86     public val onSecondaryContainer: LayoutColor = ColorTokens.ON_SECONDARY_CONTAINER.argb,
87     public val tertiary: LayoutColor = ColorTokens.TERTIARY.argb,
88     public val tertiaryDim: LayoutColor = ColorTokens.TERTIARY_DIM.argb,
89     public val tertiaryContainer: LayoutColor = ColorTokens.TERTIARY_CONTAINER.argb,
90     public val onTertiary: LayoutColor = ColorTokens.ON_TERTIARY.argb,
91     public val onTertiaryContainer: LayoutColor = ColorTokens.ON_TERTIARY_CONTAINER.argb,
92     public val surfaceContainerLow: LayoutColor = ColorTokens.SURFACE_CONTAINER_LOW.argb,
93     public val surfaceContainer: LayoutColor = ColorTokens.SURFACE_CONTAINER.argb,
94     public val surfaceContainerHigh: LayoutColor = ColorTokens.SURFACE_CONTAINER_HIGH.argb,
95     public val onSurface: LayoutColor = ColorTokens.ON_SURFACE.argb,
96     public val onSurfaceVariant: LayoutColor = ColorTokens.ON_SURFACE_VARIANT.argb,
97     public val outline: LayoutColor = ColorTokens.OUTLINE.argb,
98     public val outlineVariant: LayoutColor = ColorTokens.OUTLINE_VARIANT.argb,
99     public val background: LayoutColor = ColorTokens.BACKGROUND.argb,
100     public val onBackground: LayoutColor = ColorTokens.ON_BACKGROUND.argb,
101     public val error: LayoutColor = ColorTokens.ERROR.argb,
102     public val errorDim: LayoutColor = ColorTokens.ERROR_DIM.argb,
103     public val errorContainer: LayoutColor = ColorTokens.ERROR_CONTAINER.argb,
104     public val onError: LayoutColor = ColorTokens.ON_ERROR.argb,
105     public val onErrorContainer: LayoutColor = ColorTokens.ON_ERROR_CONTAINER.argb,
106 )
107