从图像获取主题样式 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

Java性能权威指南

Java性能权威指南

奥克斯 (Scott Oaks) / 柳飞、陆明刚、臧秀涛 / 人民邮电出版社 / 2016-3-1 / CNY 79.00

市面上介绍Java的书有很多,但专注于Java性能的并不多,能游刃有余地展示Java性能优化难点的更是凤毛麟角,本书即是其中之一。通过使用JVM和Java平台,以及Java语言和应用程序接口,本书详尽讲解了Java性能调优的相关知识,帮助读者深入理解Java平台性能的各个方面,最终使程序如虎添翼。 通过阅读本书,你可以: 运用四个基本原则最大程度地提升性能测试的效果 使用JDK中......一起来看看 《Java性能权威指南》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

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

UNIX 时间戳转换

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试