Explain the use of rgb color values and hex values in changing the color of an element in html. Give suitable examples
Answers
Answered by
3
RGB Colour values are Stated out in the form of Red - Green - Blue
These can range from (255 - 255 - 255) To make a certain combination of a colour.
An example for RGB can be, rgb( 255, 0, 0) which will give you pure red. Or you can include rgb( 255, 255, 0) in order to make Yellow.
With the Hex values, they're similar to RGB but are used with a # instead of "rgb" in the code. Hex values are related to rgb, as The first 2 digits (#000000) are related to rgb( 255, 0, 0), the middle 2 digits for the "green" area and the last 2 digits for the blue area.
Note: The Hex values aren't limited to numbers, they can also have letters.
Hex Examples are: #FFFF00 for Yellow, #000000 For Black and #FF0000 for red.
Hope this helped
Similar questions
English,
6 months ago
Physics,
6 months ago
Math,
6 months ago
Business Studies,
1 year ago
Geography,
1 year ago