问题
Is there a web app that could compute the relationship between two colors?
I have an existing style guide with established hex values. I would like to add these colors as hsla values in sass variables. I can add each one as an independent variable but I would rather base all the colors on one base color. Then use percentages of change to establish the other colors. In doing this I could color shift the theme and maintain the "correct" values in the relationships.
回答1:
Maybe a bit late, but I found this while searching for the exact same functionality:
http://ethanmuller.github.io/sass-color-function-generator-thing/
For example:
The input colors #ff0000
and #552222
result in the SASS function darken( desaturate( #ff0000, 57 ), 27 )
回答2:
There's http://sassme.arc90.com/, which does the opposite of what you're asking for, but might be helpful.
回答3:
What I ended up doing was getting the hsla value for all of the colors then manually doing the math for the percentage relations between two colors and using the results in the "adjust-color" function is sass. I am sure there is a faster way but this works.
来源:https://stackoverflow.com/questions/13807956/calculate-color-value-relationship