Android的颜色选择器 - 更新颜色阵列 [英] Android color picker - updating color array

查看:150
本文介绍了Android的颜色选择器 - 更新颜色阵列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个颜色选择器为Android,看起来像瘸子的的简约版本。所以,它有一个色调滑块和与所选择的色调滑块上的颜色的饱和度/值变体的矩形。

I'm trying to create a color picker for Android that looks like a minimalistic version of Gimp's. So, it has a hue slider and a rectangle with saturation/value variants of a color chosen in hue slider.

问:什么是创建矩形的最佳方式

Question: what is the best way to create the rectangle?

现在,我创建一个200×200像素阵列,但它需要〜5秒,以创建和显示矩形数组。而我需要的颜色矩形每当我改变色相滑块值改变...

Right now, I'm creating an 200x200 array of pixels, but it takes ~5sec to create and display rectangle with that array. And I need colors in rectangle to change whenever I change the value in hue slider...

矩形是位图,顺便说一句。我可以使用上,以及如何彩色矩阵?任何的例子吗?

Rectangle is bitmap, btw. Can I use color matrices on that and how? Any examples?

在此先感谢!

推荐答案

您可以创建根据所选择的色调的改变饱和度/值变种的矩形,与LinearGradients绘制矩形。

You can create the rectangle with saturation/value variants that change according to the selected hue, by drawing the rectangle with LinearGradients.

您可以将在code在这里:<一href="http://$c$c.google.com/p/android-color-picker/">http://$c$c.google.com/p/android-color-picker/到应用程序中。似乎这就是你想要的。

You can incorporate the code here: http://code.google.com/p/android-color-picker/ into your application. Seems that this is what you want.

这篇关于Android的颜色选择器 - 更新颜色阵列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆