从图像获取主题样式 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高并发编程详解

汪文君 / 机械工业出版社 / 2018-6 / 89.00元

本书共分为四个部分:部分详细地介绍了Java多线程的基本用法和各个API的使用,并且着重介绍了线程与Java虚拟机内存之间的关系。第二部分由线程上下文类加载器方法引入,介绍为什么在线程中要有上下文类加载器的方法函数,从而掌握类在JVM的加载和初始化的整个过程。第三部分主要围绕着volatile关键字展开,在该部分中我们将会了解到现代CPU的架构以及Java的内存模型(JMM)。后一部分,主要站在架......一起来看看 《Java高并发编程详解》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

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

Base64 编码/解码

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

UNIX 时间戳转换