closure-stylesheets
closure-stylesheets copied to clipboard
Extra color functions
Originally reported on Google Code with ID 9
Hi,
Some color functions are missing in closure stylesheets. If I take less in example,
here are some interesting functions http://lesscss.org/#-color-functions
Based on the last commit (http://code.google.com/p/closure-stylesheets/source/detail?r=6edc1c4364256f20dca2b59eddc18e38f1a41935)
I've implemented some of them :
* lighten(color, amount)
* darken(color, amount)
* saturate(color, amount)
* desaturate(color, amount)
* grayscale(color)
I join a patch which add functions. It's just a "quick and dirty" patch (based on the
code of addHsbToCssColor), but it seems to work.
In the hope you find it interesting.
++
Yves
Reported by Yves.Brissaud on 2011-12-02 12:25:33
- _Attachment: [extra_colors.patch](https://storage.googleapis.com/google-code-attachments/closure-stylesheets/issue-9/comment-0/extra_colors.patch)_
Could you please upload this to codereview.appspot.com? Things are not configured to
ingest contributions yet, but I will try my best.
In general, it would be easiest to follow the instructions on http://code.google.com/p/closure-compiler/wiki/Contributors,
though http://code.google.com/p/closure-library/wiki/Contributors has more detailed
instructions for using codereview.appspot.com.
Reported by [email protected] on 2011-12-02 22:15:12
Reported by [email protected] on 2011-12-02 22:15:41
- Labels added: Type-Enhancement
- Labels removed: Type-Defect
OK. I'll clean a little the code (it's a little dirty and I've idea to do it better)
and when it's good I'll upload on codereview. I think it will be available in the next
days.
Reported by Yves.Brissaud on 2011-12-06 09:00:53
Here is the patch uploaded to codereview : http://codereview.appspot.com/5468048/
I've update many things from the first patch (linked to this issue). Essentially by
adding some HSL functions (Luminance is used to have a lighter / darker color).
Some tests has been written and the issue contains a little test case to see the usage
of those functions.
Hope this can be usefull
Reported by Yves.Brissaud on 2011-12-08 20:14:00
@eunomie, I believe that this was your original issue and patch. If you're still interested, can you make a pull request with the updated patch? Yes, I know, it's been nearly 4 years, so if you don't care to, I completely understand. Just say so and I'll close out this bug.
Thanks for reporting my old issue :-)
See #66 for the PR.