Calculate color value relationship [closed]

南笙酒味 提交于 2020-01-02 06:47:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!