-
Notifications
You must be signed in to change notification settings - Fork 17
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
It'd be useful to be able to provide an input and output color #3
Comments
@AaronHolbrook it is possible. Essentially you would get the HSL values of the output color and compute the difference of those values from the input color's HSL values. You would then feed the differences into the sliders to have the functions generated. Currently, when you move the sliders the value of the slider you just moved is compared with the base value (input color) and the correct transformation is determined (https://github.com/arc90/sass-color-picker/blob/master/index.html#L174). Creating a new instance of Color with the output color's hex # will let you get the HSL values (http://sassme.arc90.com/docs/Color.html#section-3). Out of curiosity, how would you use this to aid with templating? |
@DarrenN that'd be awesome. Ok so here's why I need it: I'm using SASS to create a parent theme that has say 10 child themes. Those child themes simply vary in color and BG texture. So I have a couple variables set for a primary color, secondary color and tertiary color. All shades and variations are done in the original theme via color functions off one of those colors. So for instance, I need a BG shade slightly different from the primary color - and I have what the original design calls for, so I'm basically looking for the algorithm that generates the color difference between those two - i.e. my request. So yea - if you could allow for input AND output color, and have the color functions figure themselves out, that would be AWESOME! |
+1 |
5 similar comments
+1 |
+1 |
👍 |
+1 |
+1 |
@DarrenN Developers would use it when they're handed a .PSD with color values that are obviously related to a single base color. I can easily pull the primary color out. I can even easily pull the variants of that color out. I can tell that the variant color is based on the primary color. The only way to find that functional relationship is to use trial and error, which would take forever and therefore forsake the sass functions altogether. |
+1 |
FYI: The project now lives under my github jimniels/sassme (and is live at jim-nielsen.com/sassme. Any suggestions, issues, improvements, or PRs are welcome there :) |
In order to have the formula for how to get from one color to another (which is useful in templating).
Is this possible?
The text was updated successfully, but these errors were encountered: