Skip to content

Support HWB in adjust, change, and scale #1111

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

Merged
merged 4 commits into from
Oct 15, 2020
Merged

Conversation

jathak
Copy link
Member

@jathak jathak commented Oct 10, 2020

This adds $whiteness and $blackness parameters to the adjust, change, and scale functions in the color module.

In doing so, I generalized the logic for all three functions into a single _updateComponents helper since they all shared a lot of similar logic for validating their parameters.

See sass/sass#2834
See #1089

See sass/sass-spec#1577

@jathak jathak requested a review from nex3 October 10, 2020 03:24
Comment on lines 455 to 456
var hasSl = saturation != null || lightness != null;
var hasWb = whiteness != null || blackness != null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the Dart style guide, these should be hasSL and hasWB.

var whiteness = getParam("whiteness", 100);
var blackness = getParam("blackness", 100);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should assert that these parameters (but not saturation and lightness) have unit % for adjust() and change().

@nex3
Copy link
Contributor

nex3 commented Oct 13, 2020

By the way, I'm looking into the grinder error in the tests.

This adds `$whiteness` and `$blackness` parameters to the `adjust`,
`change`, and `scale` functions in the color module.

In doing so, I generalized the logic for all three functions into a
single `_updateComponents` helper since they all shared a lot of similar
logic for validating their parameters.
@jathak jathak force-pushed the hwb-function-params branch from 8c5f8be to ecca6e7 Compare October 13, 2020 21:34
@jathak jathak merged commit 6c679e1 into feature.hwb Oct 15, 2020
@jathak jathak deleted the hwb-function-params branch October 15, 2020 02:45
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

Successfully merging this pull request may close these issues.

None yet

2 participants