从图像获取主题样式 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://www.codercto.com/soft/d/4478.html

PHP经典实例(第3版)

PHP经典实例(第3版)

David Sklar、Adam Trachtenberg / 苏金国、丁小峰 / 中国电力出版社 / 2015-7 / 128.00

想要掌握PHP编程技术?或者想要学习如何完成一个特定的任务?那么一定要先看看《PHP经典实例(第3版)》。本书介绍了专门为PHP 5.4和5.5修订的350个经典技巧,并提供了丰富的示例代码。特别是对生成动态Web内容的解决方案做了全面更新,从使用基本数据类型到查询数据库,从调用RESTful API到测试和保护网站安全都有涵盖。 各个技巧都提供了示例代码,可以免费使用,另外还讨论了如何解决......一起来看看 《PHP经典实例(第3版)》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具