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

It'd be useful to be able to provide an input and output color #3

Open
AaronHolbrook opened this issue Oct 4, 2012 · 11 comments
Open

Comments

@AaronHolbrook
Copy link

In order to have the formula for how to get from one color to another (which is useful in templating).

Is this possible?

@DarrenN
Copy link
Contributor

DarrenN commented Oct 5, 2012

@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?

@AaronHolbrook
Copy link
Author

@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!

@polikin
Copy link

polikin commented Aug 9, 2013

+1

5 similar comments
@stevenbriscoeca
Copy link

+1

@edwardsdesign
Copy link

+1

@shaneog
Copy link

shaneog commented Nov 23, 2014

👍

@mhawk0
Copy link

mhawk0 commented Jan 8, 2015

+1

@joshsmith01
Copy link

+1

@joshsmith01
Copy link

@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.

@ferdis
Copy link

ferdis commented Sep 3, 2015

+1

@jimniels
Copy link
Contributor

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 :)

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

No branches or pull requests

10 participants