( theme: InternalTheme, elevation: number, customBackground?: ColorValue, elevated?: boolean )
| 23 | ]; |
| 24 | |
| 25 | export const getAppbarBackgroundColor = ( |
| 26 | theme: InternalTheme, |
| 27 | elevation: number, |
| 28 | customBackground?: ColorValue, |
| 29 | elevated?: boolean |
| 30 | ) => { |
| 31 | const { isV3, dark: isDarkTheme, mode, colors } = theme; |
| 32 | const isAdaptiveMode = mode === 'adaptive'; |
| 33 | if (customBackground) { |
| 34 | return customBackground; |
| 35 | } |
| 36 | |
| 37 | if (!isV3) { |
| 38 | if (isDarkTheme && isAdaptiveMode) { |
| 39 | return overlay(elevation, colors?.surface); |
| 40 | } |
| 41 | |
| 42 | return colors.primary; |
| 43 | } |
| 44 | |
| 45 | if (elevated) { |
| 46 | return theme.colors.elevation.level2; |
| 47 | } |
| 48 | |
| 49 | return colors.surface; |
| 50 | }; |
| 51 | |
| 52 | export const getAppbarColor = ({ |
| 53 | color, |
no test coverage detected
searching dependent graphs…