Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Design

Agnes Caringal
Agnes Caringal
6,239 Points

guys anyone can help me regarding Sass...about complement...thanks

Set a variable named $complement to be the complement of standard red.

13 Answers

Colin Marshall
Colin Marshall
32,861 Points

To get the complement of a color, you run the complement function on the color. Here's how it would look if you set a variable to the return value of the complement function:

$variable: complement($color);

Replace $variable with the name of the variable you are using and replace $color with the color you want the complement of.

Colin Marshall
Colin Marshall
32,861 Points

Can you link me to the challenge please?

Agnes Caringal
Agnes Caringal
6,239 Points

$text-color: red; $variable: complement($text-color);

a { color: lighten($text-color, 5%); }

Agnes Caringal
Agnes Caringal
6,239 Points

challenge no# 1 is done, the 2nd question is about complement

Colin Marshall
Colin Marshall
32,861 Points

Please provide the URL to the code challenge so I can help you.

Colin Marshall
Colin Marshall
32,861 Points

Your error is that you are setting the result of the complement function to $variable instead of to $complement. I only used $variable in my example so that I wasn't just giving you the answer. You don't need to set red to a variable either.

$complement: complement(red);
Agnes Caringal
Agnes Caringal
6,239 Points

what's the problem with this code?

Colin Marshall
Colin Marshall
32,861 Points

Did you try my most recent answer? Look up one answer from this one.

Colin Marshall
Colin Marshall
32,861 Points

For question #3? The link will just take you to the beginning of a challenge, it won't take you to a specific question in the challenge. Please provide your code, formatted like this:

```scss

/* code goes here */

```

Colin Marshall
Colin Marshall
32,861 Points

Please provide me with the question number you are on, not the link. And please provide me with your code that is not passing the question for that challenge.

Watch the video in the right sidebar called "Tips for asking questions" to see how to post code on the forum.

Agnes Caringal
Agnes Caringal
6,239 Points

Set the background of <a> tag to be 10% desaturated version of a variable using the desaturate function. (HINT: desaturate works a lot like the lighten function - taking a color and, then a percentage. ok, thanks for you advice.

Colin Marshall
Colin Marshall
32,861 Points

Ok, so question #3 is the one you are on. Now please provide me with your code so I can see where you are going wrong.

Agnes Caringal
Agnes Caringal
6,239 Points
/* challenge #3 */
$desaturate: desaturate(red, 10%);

a {
 background: $desaturate;
}
Colin Marshall
Colin Marshall
32,861 Points

You are close, you need to desaturate the complement of red.

$complement: complement(red);

a {
  color: lighten(red, 5);
  background: desaturate($complement, 10);
}

Also, please watch the video "Tips for asking questions" in the right sidebar of this page to see how to properly post code on the forum.

Agnes Caringal
Agnes Caringal
6,239 Points

wow...your so great! you know a lot of Sass technique...thanks

Jason Gutierrez
Jason Gutierrez
10,032 Points

I agree and his answer just helped me out as well. Thanks for the help Colin.

This challenge has been difficult.But i latter realized that i was failing a small part which is on the challenge number 3.It was a bit tricky but finally i picked it.Well done TeamTreehouse.