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

Better implementation of luma #1148

Merged
merged 1 commit into from Jan 23, 2013
Merged

Better implementation of luma #1148

merged 1 commit into from Jan 23, 2013

Conversation

Synchro
Copy link
Member

@Synchro Synchro commented Jan 23, 2013

This is really how I originally intended to implement luma but couldn't quite figure it out at the time!
This makes luma a function of the color object rather than a less function. It retains that interface, but it now means that the luma calculation only happens in one place (previously it was in two). The color object's luma function does not look at alpha, but the luma and contrast less functions do take alpha into account.
Also integrates a tweak to the contrast function that means that light and dark parameters are set according to their luma value, not their order, so the result of these will be the same:

@a: contrast(#fff, #eeeeee, #111111);
@b: contrast(#fff, #111111, #eeeeee);

I don't think this has any BC issues. All test cases still pass, and I've added a case for the contrast tweak.

@lukeapage
Copy link
Member

Nice, good work 👍

Synchro added a commit that referenced this pull request Jan 23, 2013
Better implementation of luma
@Synchro Synchro merged commit 26d35c9 into less:master Jan 23, 2013
@Synchro
Copy link
Member Author

Synchro commented Jan 23, 2013

Thanks!

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