We talk about the three different basic color conventions,
the main ones that people use.
Conventions is just another word for suggestions.
It's not a rule.
You don't have to follow the rules I'm going to give you.
It's just the way that most programmers program so
that they can understand what you're trying to do, when they look at your code.
One way that you cn add color is to just simply use the English word.
Blue, red, yellow, etc.
These work, and they'll show up fine on your page.
The problem is, is that it's not consistent across the pages.
What's yellow to one browser is not the exact same shade
of yellow to another browser.
So in general, we avoid color names when your final project is coming up.
When you're just coding and hacking away,
you just want to pop something up on the screen.
No problem.
Use blue or red or yellow but then later what you're going to want to do.
It changed when these other two conventions I'm going to talk about.
The first one is called hexadecimal.
Hexadecimal you might recognize the decimal part,
that's how we count from zero to nine.
Hexadecimal just means they have sixteen digits instead of ten.
So you can use zero to nine, but then also A, B, C, D, E, and F.
And F is kind of like the strongest, most powerful number you can use.
When you do hexadecimal, it's always set up the same,
where you have a pound sign followed by either three or six digits.
The examples I have here for you are six digits.
And the way it works is that you have a red, green, and blue value, and
the bigger the number you put in there, the more red, green, or blue you'll see.
So here's my example.
I have an example of blue, red, but
also yellow because depending on how much of these different values you put in,
it's can change the color that's gonna show up on your screen.
Now hexadecimal is probably the most common way of doing colors when you look
at a lot of people's pages, but another way that's coming up a lot is the RGB.
Again, it's the same idea that we have red, green, and blue,
but instead of using these kind of strange hexadecimal numbers, the zero to F,
instead you're using numbers between zero and one.
So here I've done the same thing, I've just done one, one, and one, one.
I could have just as easily put 0.5, 0.8, 0.6, and
that would change the strength of the color.
So here I have rgb (0,0,1).
One of the reasons that people have been switching over to rgb is that there's
another option called rgba.
And for the longest time I really had to think about what that a meant and
what it stands for is alpha transparency.
So you have a fourth value on the end that says, you know what?
I want to use this blue color, but I wanna kind of make it a little bit see through.
So when it comes up,
if I were to actually make it zero it would be completely see through.
If I were to give it a final value of one,
it would look just like the regular rgb value.
Now one of the interesting things to note is that, if you're watching this video
right now and there's someone next to you watching the video on their screen.
It's absolutely possible that if you look over, It looks different.
You need to remember that different monitors can display colors in
different ways, all right?
So I want to show you an example really quick on the web
of how you can see some of these different colors and how they're working.
What I brought up here is my course webpage and it's okay if you can't see it.
I know it's kind of small.
What I want to show you is me using something called Inspect Element
to really kind of look at my page, and look at the colors,
and a really quick way for me to see how I can make it look different.
So I have my mouse, right here.
I'm gonna right-click, and i'm gonna go down to Inspect Element.