({
primary,
secondary,
tertiary,
type,
custom,
}: CustomTheme)
| 170 | }; |
| 171 | |
| 172 | export const prepareVariant = ({ |
| 173 | primary, |
| 174 | secondary, |
| 175 | tertiary, |
| 176 | type, |
| 177 | custom, |
| 178 | }: CustomTheme) => { |
| 179 | const baseTheme = argbThemeFromColor(primary, type); |
| 180 | |
| 181 | if (secondary) { |
| 182 | const secondaryTheme = argbThemeFromColor(secondary, type); |
| 183 | baseTheme.secondary = secondaryTheme.primary; |
| 184 | baseTheme.onSecondary = secondaryTheme.onPrimary; |
| 185 | baseTheme.secondaryContainer = secondaryTheme.primaryContainer; |
| 186 | baseTheme.onSecondaryContainer = secondaryTheme.onPrimaryContainer; |
| 187 | } |
| 188 | |
| 189 | if (tertiary) { |
| 190 | const tertiaryTheme = argbThemeFromColor(tertiary, type); |
| 191 | baseTheme.tertiary = tertiaryTheme.primary; |
| 192 | baseTheme.onTertiary = tertiaryTheme.onPrimary; |
| 193 | baseTheme.tertiaryContainer = tertiaryTheme.primaryContainer; |
| 194 | baseTheme.onTertiaryContainer = tertiaryTheme.onPrimaryContainer; |
| 195 | } |
| 196 | |
| 197 | const theme = argbThemeToRgbTheme(baseTheme); |
| 198 | const elevation = prepareElevations(baseTheme); |
| 199 | const surfaceColors = prepareSurfaceColors(baseTheme); |
| 200 | const customColors = prepareCustomColors(type, custom); |
| 201 | |
| 202 | return { |
| 203 | ...theme, |
| 204 | elevation, |
| 205 | ...surfaceColors, |
| 206 | ...customColors, |
| 207 | }; |
| 208 | }; |
| 209 | |
| 210 | export const prepareThemes = (colors: RGBColorList) => { |
| 211 | const light = prepareVariant({ |
no test coverage detected
searching dependent graphs…