Navigate back to the homepage

RGB in react native

Infinitbility
Style
May 2nd, 2021 · 1 min read
RGB in react native

Hi Devs’,

Welcome to infinitbility,

This article help you to use rgb() in react native same like we use in web.

let’s start today topic RGB in react native Or how to use rgb() in react native

The rgb() function define colors using the Red-green-blue (RGB) model.

An RGB color value is specified with: rgb(red, green, blue). Each parameter defines the intensity of that color and can be an integer between 0 and 255 or a percentage value (from 0% to 100%).

For example, the rgb(0,0,255) value is rendered as blue, because the blue parameter is set to its highest value (255) and the others are set to 0.

Let’s understand with example of using rgb method

rgbExample.js

1import React from 'react';
2import { StyleSheet, Text, View } from 'react-native';
3
4const LotsOfStyles = () => {
5 return (
6 <View style={styles.textContainer}>
7 <Text style={[styles.text, {fontSize: 50, fontWaight: "900"}]}>Infinitbility</Text>
8 <Text style={styles.text}>We have the ability to build infinite way for us.</Text>
9 </View>
10 );
11};
12
13const styles = StyleSheet.create({
14 textContainer: {
15 flex: 1,
16
17 },
18 text: {
19 fontSize: 30,
20 textAlign: 'center',
21 color: 'rgb(120, 245, 67)',
22 }
23});
24
25export default LotsOfStyles;

Output

RGB color

Thanks For Reading…

Join our email list and get notified about new content

No worries, I respect your privacy and I will never abuse your email.

Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.

Looking For React Native Tutorial?

we are trying to create the best Tutorial for react native developers.

When you want a daily updates about React Native Tutorial or infinitbility update subscribe to our newsletter.

Read React Native Tutorial

Request New Tutorial or Article on mail [email protected]

More articles from Infinitbility

Text align in react native

Text align in react native

React Native Tutorial - how to align text in react native

May 1st, 2021 · 1 min read
fontStyle in react native

fontStyle in react native

React Native Tutorial - how do make italic text in react native

April 30th, 2021 · 1 min read
© 2021 Infinitbility
Link to $https://medium.com/infinitbilityLink to $https://www.facebook.com/InfinitbilityLink to $https://github.com/infinitbilityLink to $https://twitter.com/infinitbilityLink to $https://www.buymeacoffee.com/infinitbilityLink to $mailto:[email protected]