ColorArt 从图像获取主题样式

程序名称:ColorArt

授权协议: Apache

操作系统: Android

开发语言: Java

ColorArt 介绍

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);

示例测试截图:

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

ColorArt 官网

https://github.com/MichaelEvans/ColorArt

相关编程语言

BBGestureBack Full screen return gesture(全屏手...
Framework7 或者叫 F7 是全功能的绑定 iOS 7 应用的...
iOS 调试库,支持 iOS8+,无需添加任何代码,方便 i...
DarkModeKit是在Apple官方的深色模式发布之前设计和...
SimpleNote iOS 版客户端。SimpleNote 是一款在多平...
Kivy iOS,此工具旨在为 iOS 编译必要的库以运行应用...