Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighten on dark colors #26

Closed
micnigh opened this issue Jul 21, 2014 · 1 comment
Closed

Lighten on dark colors #26

micnigh opened this issue Jul 21, 2014 · 1 comment

Comments

@micnigh
Copy link

micnigh commented Jul 21, 2014

I've noticed lighten produces unexpected colors the closer it is to #000. This applies to both scss and less files.

Here is a sample for reproduction

$black: #000;

$lighten-black: lighten($black, 50%);
$lighten-black: lighten($black, 100%);
$lighten-black: lighten($black, 1000%);

$almost-black: #111;

$lighten-almost-black: lighten($almost-black, 50%);
$lighten-almost-black: lighten($almost-black, 100%);
$lighten-almost-black: lighten($almost-black, 1000%);

$white: #fff;

$darken-white: darken($white, 50%);
$darken-white: darken($white, 100%);
$darken-white: darken($white, 1000%);

produces

image

I found the issue when I noticed bootstrap colors weren't matching up.

image

I'm currently using Atom Color Highlight v0.19.2

Love the tool btw!

@abe33
Copy link
Owner

abe33 commented Jul 22, 2014

Thanks for the report, seems like it will be tougher than I thought, I was assuming that all three preprocessors were behaving the same regarding color transformation, but I was wrong. The current implementation is based on the stylus version, that add the percentage of the original lightness to the color, sass and less add an absolute value:

Stylus:

lighten(#808080, 50%) // #c0c0c0

Sass/Less

lighten(#808080, 50%) // #ffffff

I'll have to think of how to detect the language used to switch versions when computing the final value.

abe33 added a commit that referenced this issue Jul 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants