santomegonzalo / react-native-floating-action

Material design action button for React Native
MIT License
489 stars 180 forks source link

iconColor is not working on icons for the main floating button #218

Open meerita opened 2 years ago

meerita commented 2 years ago

Hi there,

I just tried to use the iconColor prop, to tint the color of the icons I use on the main buttons and it doesn't work.

<FloatingAction actions={actions} onPressItem={name => { console.log(selected button: ${name}); }} color={darkMode ? Colors.dark.primary : Colors.light.primary} iconWidth={24} iconHeight={24} iconColor='#FF0000' floatingIcon={require('../../assets/images/icons/event.png')} actionsPaddingTopBottom={4} />

After checking the source code, I've noticed that the element doesn't support tintColor at all.

return ( <Image style={{ width: iconWidth, height: iconHeight }} source={floatingIcon} /> );

In order to change the color of the icon, both cases must allow style={{ tintColor: iconColor }} otherwise the icon remains with the original color I have on the image.

On the meantime I will create white icons images so I don't need to tint them.