--description--
Just like with hex code, you can mix colors in RGB by using combinations of different values.
--instructions--
Replace the hex codes in our style
element with their correct RGB values.
Color | RGB |
---|---|
Blue | rgb(0, 0, 255) |
Red | rgb(255, 0, 0) |
Orchid | rgb(218, 112, 214) |
Sienna | rgb(160, 82, 45) |
--hints--
Your h1
element with the text I am red!
should have the color
red.
assert($('.red-text').css('color') === 'rgb(255, 0, 0)');
You should use rgb
for the color red.
assert(
code.match(
/\.red-text\s*{\s*color\s*:\s*rgb\(\s*255\s*,\s*0\s*,\s*0\s*\)\s*;?\s*}/gi
)
);
Your h1
element with the text I am orchid!
should have the color
orchid.
assert($('.orchid-text').css('color') === 'rgb(218, 112, 214)');
You should use rgb
for the color orchid.
assert(
code.match(
/\.orchid-text\s*{\s*color\s*:\s*rgb\(\s*218\s*,\s*112\s*,\s*214\s*\)\s*;?\s*}/gi
)
);
Your h1
element with the text I am blue!
should have the color
blue.
assert($('.blue-text').css('color') === 'rgb(0, 0, 255)');
You should use rgb
for the color blue.
assert(
code.match(
/\.blue-text\s*{\s*color\s*:\s*rgb\(\s*0\s*,\s*0\s*,\s*255\s*\)\s*;?\s*}/gi
)
);
Your h1
element with the text I am sienna!
should have the color
sienna.
assert($('.sienna-text').css('color') === 'rgb(160, 82, 45)');
You should use rgb
for the color sienna.
assert(
code.match(
/\.sienna-text\s*{\s*color\s*:\s*rgb\(\s*160\s*,\s*82\s*,\s*45\s*\)\s*;?\s*}/gi
)
);
--seed--
--seed-contents--
<style>
.red-text {
color: #000000;
}
.orchid-text {
color: #000000;
}
.sienna-text {
color: #000000;
}
.blue-text {
color: #000000;
}
</style>
<h1 class="red-text">I am red!</h1>
<h1 class="orchid-text">I am orchid!</h1>
<h1 class="sienna-text">I am sienna!</h1>
<h1 class="blue-text">I am blue!</h1>
--solutions--
<style>
.red-text {
color: rgb(255, 0, 0);
}
.orchid-text {
color: rgb(218, 112, 214);
}
.sienna-text {
color: rgb(160, 82, 45);
}
.blue-text {
color:rgb(0, 0, 255);
}
</style>
<h1 class="red-text">I am red!</h1>
<h1 class="orchid-text">I am orchid!</h1>
<h1 class="sienna-text">I am sienna!</h1>
<h1 class="blue-text">I am blue!</h1>