invertase / react-native-material-design

React Native UI Components for Material Design
http://react-native-material-design.github.io
MIT License
3.15k stars 365 forks source link

getColor() returns default color for strings like 'red', 'green' etc. #39

Closed farwayer closed 8 years ago

NoWay1201 commented 8 years ago

Hmm. I don't understand where is your problem. For string 'red' it should return hex of red500 color.

farwayer commented 8 years ago

Button is red:

<Button text="Hello!" raised={true} overrides={{backgroundColor: '#ff0000'}} />

Button is blue:

<Button text="Hello!" raised={true} overrides={{backgroundColor: 'red'}} />
NoWay1201 commented 8 years ago

I see your problem. This is because there is no color like red in material palette. You probably want to use googleRed (100, 300, 500 or 700 - if not specified, it will be 500) or paperRed (100,200,300...). The Button is blue, because PRIMARY color is paperBlue. If you want to see whole palette of COLOR, just import it from react-native-material-design and make a console.log(COLOR);