Components in React Native are styled using JavaScript. Color properties usually match how CSS works on the web.
React Native supports rgb()
and rgba()
in both hexadecimal and functional notation:
'#f0f'
(#rgb)
'#ff00ff'
(#rrggbb)
'rgb(255, 0, 255)'
'rgba(255, 255, 255, 1.0)'
'#f0ff'
(#rgba)
'#ff00ff00'
(#rrggbbaa)
hsl()
and hsla()
is supported in functional notation:
'hsl(360, 100%, 100%)'
'hsla(360, 100%, 100%, 1.0)'
transparent
This is a shortcut for rgba(0,0,0,0)
:
'transparent'
You can also use color names as values. React Native follows the CSS3 specification:
© 2015–2018 Facebook Inc.
Licensed under the Creative Commons Attribution 4.0 International Public License.
https://facebook.github.io/react-native/docs/colors