从图像获取主题样式ColorArt.zip
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
- 1
- 粉丝: 492
- 资源: 1万+
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助