Premium Only Content

CSS Color Values with Hex Code and RGB
The lecture introduces you to another way of specifying a color in CSS.
Previously you learned that you can specify the color name, like red, green, or blue. But there are other ways of defining a color value, like using the hex value or the rgb value.
The hexadecimal value (aka hex) is a value that ranges from 0 to 255 in base 10, but is written in base 16 ranging from 0 to ff. That's why it's called hexadecimal, because one digit can have 16 different characters. It goes from the usual 0 to 9, then after that is goes using the letters a through f.
For the specific case of color hex codes, there are usually six digits. The first two digits are the value for the Red. The middle two digits are the values for the Green. The last two digits are the value for the Blue. Hence the abbreviation RGB whenever you need to compose those three colors to build any one color. For CSS, the hex value is always prefixed with a hash or pound sign.
You can also specify color values using base-10 RGB by saying rgb followed by parentheses. Inside the parentheses you write the values for RGB, separated by a comma. For example, for the Red value, instead of writing ff in hexadecimal, you would write 255 in decimal.
To show the red color, simply use value 255 for Red, 0 for Green, and 0 for Blue.
To show the green color, simply use value 0 for Red, 255 for Green, and 0 for Blue.
To show the blue color, simply use value 0 for Red, 0 for Green, and 255 for Blue.
-
LIVE
The Pete Santilli Show
4 days agoSupreme Court (Not Barrett) Allows Trump Admin to Enforce Deportations of Gang Members [EP 4506-8AM]
1,178 watching -
13:17
Clownfish TV
13 hours agoSnow White Only Made $5 MILLION...
31.1K38 -
4:50
SKAP ATTACK
15 hours ago $2.68 earnedLuka OWNS SGA
24.3K7 -
44:24
TheTapeLibrary
18 hours ago $3.97 earnedThe Strangest UFO Encounters Ever Recorded
40.7K3 -
21:36
JasminLaine
15 hours agoCarney MOCKS Danielle Smith—Clapback Leaves Him SPEECHLESS, Media Stays Silent
31.1K49 -
13:46
ThinkStory
19 hours agoTHE WHITE LOTUS Season 3 Ending Explained!
28K2 -
58:09
CarlCrusher
23 hours agoHunting for UFO Portals on Ancient Ley Lines
28.1K2 -
32:06
This Bahamian Gyal
16 hours agoGoing BROKE to look RICH | This Bahamian Gyal
31K5 -
26:47
Degenerate Plays
14 hours ago $0.85 earnedBatman Ended This Man's Whole Career - Gotham Knights : Part 46
23.4K2 -
36:26
The Screwtape Letters: Confronting Evil in Our Time -Â Podcast
11 days agoStage 4 to Cancer Free - The Miracle Patient Interview with Dan Thompson
20.8K3