View video tutorial

HTML RGB Colors

HTML

RGB colors are created with different combinations of Red, Greed and Blue colors.

Select and convert your color code in RGB | HEX | HSL


RGB color code.

Change RGB value to get a color code.

HTML RGB Colors


In RGB colors there are three basic red,green,blue color combination together to make new color.

Each color range from minimum 0 to maximum 255 value.

rgb(red, green, blue) method is used with color as a parameter value.

rgba(red, green, blue, alpha) method is used with color as a parameter value and alpha is the opacity of the new color.

rgb(255, 0, 0)

rgb(0, 0, 255)

rgb(60, 179, 113)

rgb(238, 130, 238)

rgb(255, 165, 0)

rgb(106, 90, 205)

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.

Example

<!DOCTYPE html>
<html>

<head>
    <title>HTML RGB Color Example</title>
</head>

<body>

    <h2>HTML RGB Color Example</h2>

    <h2 style="background-color:rgb(255, 0, 0);">rgb(255, 0, 0)</h2>
    <h2 style="background-color:rgb(0, 0, 255);">rgb(0, 0, 255)</h2>
    <h2 style="background-color:rgb(60, 179, 113);">rgb(60, 179, 113)</h2>
    <h2 style="background-color:rgb(238, 130, 238);">rgb(238, 130, 238)</h2>
    <h2 style="background-color:rgb(255, 165, 0);">rgb(255, 165, 0)</h2>
    <h2 style="background-color:rgb(106, 90, 205);">rgb(106, 90, 205)</h2> 

</body>

</html>
Try it Now »

Click on the "See output" button to see how it works.


Shades of gray color

Gray color is the color where Red, Green and Blue value for RGB are equal.