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 doesn't work on black color #150

Closed
mk0y opened this issue Oct 22, 2018 · 3 comments
Closed

Lighten doesn't work on black color #150

mk0y opened this issue Oct 22, 2018 · 3 comments
Labels

Comments

@mk0y
Copy link

mk0y commented Oct 22, 2018

Hi,

If you try

color('#000000').lighten(0.5).hex()

you'll get again #000000 color.

Is this a bug?

Cheers!

@Qix- Qix- added the question label Oct 22, 2018
@Qix-
Copy link
Owner

Qix- commented Oct 22, 2018

Lighten is based on a ratio (multiplication), not absolute values (addition), of the lightness channel in the HSL model.

Therefore, the lightness of black is 0, when you lighten by 0.5, you're doing 0 * 0.5 - which is still 0.

For the question of whether or not this is a bug, the answer is objectively "no" - whether or not it's preferred is an ongoing discussion in #53, one that I am very much open to.

Feel free to chime in there :)

Closing as a duplicate.

@Qix- Qix- closed this as completed Oct 22, 2018
@mririgoyen
Copy link

I'm sorry, but I absolutely have to disagree. This package makes the bold statement:

Manipulation functions by CSS tools like Sass, LESS, and Stylus.

Using lighten in Sass works on black. This is absolutely a bug.

@Qix-
Copy link
Owner

Qix- commented Mar 18, 2019

@goyney You seem to have missed my paragraph about objectivity vs. subjectivity:

For the question of whether or not this is a bug, the answer is objectively "no" - whether or not it's preferred is an ongoing discussion in #53, one that I am very much open to.

However, I don't see a comment there from you. Perhaps that would have been a good place to start 👍

Repository owner locked as off-topic and limited conversation to collaborators Mar 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants