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

A more generic Color extension #14

Open
jide opened this issue Aug 13, 2010 · 2 comments
Open

A more generic Color extension #14

jide opened this issue Aug 13, 2010 · 2 comments
Labels

Comments

@jide
Copy link

jide commented Aug 13, 2010

I see the rewrite has made a lot of progress, and it's brilliant ! I can't wait for the functions to be implemented.

Using Scaffold a lot these times, I was thinking that a generic Color class would be a great thing to have. What I mean by "generic" is a function that would let us manipulate and convert colors from one single function. It would take a color as input, have an output format and return the reformatted color.

This would give "color input" -> "color output" :

background: color(#FF0000, rgb); // would output rgb(XXX, XXX, XXX);
background: color(rgb(250, 134, 155), hex); // would output #XXXXXX;
background: color(hsla(250, 134, 155, 80), rgba); // would output rgba(XXX, XXX, XXX, XXX);
background: color(rgba(250, 134, 155, 50), image); // would output url(path/to/transparent-image.png);
and so on...

Another thing that could be great would be the ability to manipulate those colors using rgb or hsl :

background: color(hsl-adjust(#FF0000, +10, -10, +20), rgb);
background: color(rgb-adjust(#FF0000, +100, -50, +20), hex);

The implementation is to be thought a little more obviously, but you get the idea. Maybe it could be pluggable to handle some more cases.

Any thought ?

@jide
Copy link
Author

jide commented Aug 13, 2010

I already implemented a hsl-adjust method for the previous version of Scaffold, and I may actually be able to help here.

@balupton
Copy link
Contributor

Sounds great. +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants