Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 less 中,我们可以对颜色进行算术运算。例如:
startColor * middleColor = endColor
startColor - middleColor = endColor
如果我们知道 startColor 和 endColor,是否有工具可以帮助找到 middleColor?
感谢您的回答,但我不想手动使用颜色进行操作。请给我一个工具的链接。它一定在某个地方
查看jQuery 颜色插件
您可以将任何颜色传递给它,并执行与颜色相关的操作,例如添加/删除色调、饱和度、亮度、alpha 等。您可以让它返回各种形式的颜色,例如 rgb(a)、hsl(a ) 和十六进制。
使用strsplit或split函数,获取每种颜色(rgb、红绿蓝)的值做数学运算。
strsplit
split
您可以将它们转换为十进制以便更好地理解,因为 web 中的默认值是十六进制。