How to convert RGB into Hex color code
RGB color code can be converted into Hex code by converting each value from RGB (Red, Green and Blue) into Hexadecimal code. This converted code is represented using two digits. In this way the complete hex code consist of 6 digits. Consequently first two digits for Red, second two fro Green and last two digits for Blue color.
Uses of Hex Color code
There are multiple uses of hex color codes. If we talk about the computer science, then it is commonly used in graphics manipulation. Here hex code is used for assignment of colors to different object or pixels. We have numerous use of hex color code in designing web sites (web pages) using CSS.
Difference between RGB and Hex code
Sr. | RGB | Hex |
---|---|---|
1 | It consist of three values. | It consist of single value. |
2 | There is no prefix used for RGB color code. | Hex color code starts with # (hash) symbol. |
3 | The value of each R,G and B must be between 0 and 255. | In Hex color code the maximum value is #FFFFFF and minimum value is #000000 . |
4 | RGB function from specific language is used to interpret RGB color code. | Hex color code value is used directly without use of any function. |
5 | RGB color code values are easy to remember and understand. | Hex color values are difficult to remember. |
RGB and Hex Code Example
Sr. | Color | Hex | RGB |
---|---|---|---|
1 | Black | #000000 | 0,0,0 |
2 | White | #FFFFFF | 255,255,255 |
3 | Red | #FF0000 | 255,0,0 |
4 | Green | #00FF00 | 0,255,0 |
5 | Blue | #0000FF | 0,0,255 |
We can also convert each individual value of Red, Green and Blue using Decimal to Hexadecimal Converter.
