MCPcopy
hub / github.com/callstack/react-native-paper / getIconButtonColor

Function getIconButtonColor

src/components/IconButton/utils.ts:148–190  ·  view source on GitHub ↗
({
  theme,
  disabled,
  mode,
  selected,
  customIconColor,
  customContainerColor,
  customRippleColor,
}: {
  theme: InternalTheme;
  disabled?: boolean;
  selected?: boolean;
  mode?: IconButtonMode;
  customIconColor?: string;
  customContainerColor?: string;
  customRippleColor?: ColorValue;
})

Source from the content-addressed store, hash-verified

146};
147
148export 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};

Callers 2

IconButton.tsxFile · 0.90

Calls 4

getIconColorFunction · 0.70
getBackgroundColorFunction · 0.70
getRippleColorFunction · 0.70
getBorderColorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…