({
theme,
isOutlined,
disabled,
selectedColor,
}: BaseProps & {
selectedColor?: string;
})
| 57 | }; |
| 58 | |
| 59 | const getTextColor = ({ |
| 60 | theme, |
| 61 | isOutlined, |
| 62 | disabled, |
| 63 | selectedColor, |
| 64 | }: BaseProps & { |
| 65 | selectedColor?: string; |
| 66 | }) => { |
| 67 | const isSelectedColor = selectedColor !== undefined; |
| 68 | if (theme.isV3) { |
| 69 | if (disabled) { |
| 70 | return theme.colors.onSurfaceDisabled; |
| 71 | } |
| 72 | |
| 73 | if (isSelectedColor) { |
| 74 | return selectedColor; |
| 75 | } |
| 76 | |
| 77 | if (isOutlined) { |
| 78 | return theme.colors.onSurfaceVariant; |
| 79 | } |
| 80 | |
| 81 | return theme.colors.onSecondaryContainer; |
| 82 | } |
| 83 | |
| 84 | if (disabled) { |
| 85 | return theme.colors.disabled; |
| 86 | } |
| 87 | |
| 88 | if (isSelectedColor) { |
| 89 | return color(selectedColor).alpha(0.87).rgb().string(); |
| 90 | } |
| 91 | |
| 92 | return color(theme.colors.text).alpha(0.87).rgb().string(); |
| 93 | }; |
| 94 | |
| 95 | const getDefaultBackgroundColor = ({ |
| 96 | theme, |
no outgoing calls
no test coverage detected
searching dependent graphs…