({
theme,
disabled,
mode,
selected,
customIconColor,
customContainerColor,
customRippleColor,
}: {
theme: InternalTheme;
disabled?: boolean;
selected?: boolean;
mode?: IconButtonMode;
customIconColor?: string;
customContainerColor?: string;
customRippleColor?: ColorValue;
})
| 146 | }; |
| 147 | |
| 148 | export const getIconButtonColor = ({ |
| 149 | theme, |
| 150 | disabled, |
| 151 | mode, |
| 152 | selected, |
| 153 | customIconColor, |
| 154 | customContainerColor, |
| 155 | customRippleColor, |
| 156 | }: { |
| 157 | theme: InternalTheme; |
| 158 | disabled?: boolean; |
| 159 | selected?: boolean; |
| 160 | mode?: IconButtonMode; |
| 161 | customIconColor?: string; |
| 162 | customContainerColor?: string; |
| 163 | customRippleColor?: ColorValue; |
| 164 | }) => { |
| 165 | const isMode = (modeToCompare: IconButtonMode) => { |
| 166 | return mode === modeToCompare; |
| 167 | }; |
| 168 | |
| 169 | const baseIconColorProps = { |
| 170 | theme, |
| 171 | isMode, |
| 172 | disabled, |
| 173 | selected, |
| 174 | }; |
| 175 | |
| 176 | const iconColor = getIconColor({ |
| 177 | ...baseIconColorProps, |
| 178 | customIconColor, |
| 179 | }); |
| 180 | |
| 181 | return { |
| 182 | iconColor, |
| 183 | backgroundColor: getBackgroundColor({ |
| 184 | ...baseIconColorProps, |
| 185 | customContainerColor, |
| 186 | }), |
| 187 | rippleColor: getRippleColor({ theme, iconColor, customRippleColor }), |
| 188 | borderColor: getBorderColor({ theme, disabled }), |
| 189 | }; |
| 190 | }; |
no test coverage detected
searching dependent graphs…