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在这里: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.