看网上好像没什么对这个库的介绍,搬上来备用,提取主题色算是现代UI设计实现中很重要的工具了。
官网
https://lokeshdhakar.com/projects/color-thief/
内含样例和FAQ
这里介绍的是它的Python实现,项目网址在:
https://github.com/fengsp/color-thief-py
pip安装
pip install colorthief
使用
1 | from colorthief import ColorThief |
输出类似:
1 | #dominant color |