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

CSS

Louis Lantos
Louis Lantos
766 Points

Complement doesn't work with greyscale?

Hi,

I guess this isn't so much an issue with the tutorial, as using actual colours (such as red, blue, green, etc.) works with using complement, but complement doesn't derive the opposite of greyscale hex values. Is this an error on my part, or is this just something Sass doesn't do?

I've tried using black, white, and any number of grey values, but with no luck, it always just returns the same colour, not the opposite.

Thanks

2 Answers

Hi Louis,

The main thing to remember about complementary colors is that they are opposite one another on a color wheel. Black and white are technically not colors - black is the absence of color, and white is the combination of all colors. Certainly you can get effective contrast and pleasing design with black and white, but they are essentially neutral colors, as is gray - meaning that they can typically work with any other color.

There's more to color theory than the above, but hopefully that basically answers why you're not getting a 'complement' to a given greyscale value - gray isn't on the color wheel, so there's nothing 'opposite' it to form a complement.

Louis Lantos
Louis Lantos
766 Points

Of course! I had a suspicion that may be it. It's certainly good to know I didn't take a misstep on the deep dive! Thanks for the answer.