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

Possible bug in scaling lightness #26

Open
patricknelson opened this issue Jul 21, 2022 · 0 comments
Open

Possible bug in scaling lightness #26

patricknelson opened this issue Jul 21, 2022 · 0 comments

Comments

@patricknelson
Copy link

I found blend.scale() to work in an unexpected way. I'm not sure if I'm simply mistaken or if maybe this is a bug (or something else). For example, I had a fairly dark test color #592e13 which has a lightness of ~24%. When I used blend.scale() to reduce it by 4% (see below) the lightness of the resulting color was ~23% and not the expected ~20%:

@use "path/to/blend" as blend;

$baseColor: #592e13;
@debug blend.lightness($baseColor); // 24.3875424652%

$scaleColor: blend.scale($baseColor, $lightness: -4%);
@debug blend.lightness($scaleColor); // 23.3712907673%

$fromColor: blend.from($baseColor, blend.lightness($baseColor) - 4%, c, h);
@debug blend.lightness($fromColor); // 20.3776211491%

So, it looks like $lightness is being interpreted as the percent of the current color's lightness and not in overall lightness (i.e. relative to 100% lightness). Is this intentional?

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

1 participant