Hexadecimal Colors

Hexadecimal colors may sound complicated, but they actually work the same way as RGB colors. Hexadecimal colors also have red, green, and blue components.

The minimum value of a hexadecimal color component is 00, and the maximum value is FF. You might wonder how we can compare letters (FF) with numbers (00). It's more complex, but for our purposes, we just need to know that letters in hexadecimal form can be converted to the numbers we are familiar with. For example, FF would be converted to 255, which is also the maximum value for an RGB component.

Example:

p {
	color: #00FF00;
}

The # symbol indicates that a hexadecimal color follows. The first two zeros (00) represent the value of the red component. The second two F's (FF) represent the value of the green component, and the last two zeros (00) represent the value of the blue component. Therefore, the resulting color of the paragraph would be green.

We would write the color black as follows: #000000, and white as: #FFFFFF, for the same reasons as with RGB colors.

Hexadecimal colors are the most commonly used color format in design and programming, mainly due to their minimalist representation.

Instructions

Change the color of paragraphs (p) to the following color: #2A231B.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

4/8