Android color picker - updating color array

后端 未结 4 1194
粉色の甜心
粉色の甜心 2020-12-17 02:16

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

相关标签:
4条回答
  • 2020-12-17 02:56

    OpenIntents has a very nice color picker you can use. It can be installed as an independent app and launched with Intents.

    • Code: http://code.google.com/p/openintents/source/browse/#svn/trunk/ColorPicker
    • Screenshots/download: http://www.openintents.org/en/colorpicker
    • Intent specification: http://www.openintents.org/en/node/670
    0 讨论(0)
  • 2020-12-17 02:58

    One possibility is to pre-create the rectangles on your developer PC for each slider position, embed them as resources, and then swap in the right one when the slider changes. This may make for a portly application, but it will be nice and quick.

    I have not dealt with the 2D graphics API much, so I don't know if there are other possibilities (e.g., color matrices).

    0 讨论(0)
  • 2020-12-17 03:03

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

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

    0 讨论(0)
  • 2020-12-17 03:03

    Can this be applied to an image color picker as well?

    Use case:

    1. Select a particular pixel on an image.
    2. The pixel selected generates a color on a rectangle shape.
    3. Perhaps generating color codes for the pixel selected?
    0 讨论(0)
提交回复
热议问题