从图像获取主题样式 ColorArt

码农软件 · 软件分类 · Android UI 组件 · 2019-04-27 08:27:51

软件介绍

ColorArt 是一个Android开源库,可方便地从图像中自动获取主题样式的代码库。这个项目最初的版本出自流行的 Panic 的 OS X library。

这里记录下Android版的ColorArt的使用方法:

向build.gradle文件增加依赖库ColorArt:

compile 'org.michaelevans.colorart:library:0.0.1'

使用API:

// get a bitmap and analyze it
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.album);
ColorArt colorArt = new ColorArt(bitmap);
 
// get the colors
colorArt.getBackgroundColor()
colorArt.getPrimaryColor()
colorArt.getSecondaryColor()
colorArt.getDetailColor()
FadingImageView

FadingImageView类:

mFadingImageView.setBackgroundColor(colorArt.getBackgroundColor(), FadingImageView.FadeSide.LEFT);
//This will set the fading edge on the left side, with that background color. You can also enable/disable the fade with:
 
mImageView.setFadeEnabled(true/false);

示例测试截图:

Jim NoirPing Pong OrchestraHotel Shampoo 

介绍内容来自:http://blog.objcc.com/colorart/

本文地址:https://codercto.com/soft/d/4478.html

数学之美

数学之美

吴军 / 人民邮电出版社 / 2012-5-1 / 45.00元

几年前,“数学之美”系列文章原刊载于谷歌黑板报,获得上百万次点击,得到读者高度评价。读者说,读了“数学之美”,才发现大学时学的数学知识,比如马尔可夫链、矩阵计算,甚至余弦函数原来都如此亲切,并且栩栩如生,才发现自然语言和信息处理这么有趣。 今年,作者吴军博士几乎把所有文章都重写了一遍,为的是把高深的数学原理讲得更加通俗易懂,让非专业读者也能领略数学的魅力。读者通过具体的例子学到的是思考问题的......一起来看看 《数学之美》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换