public static final class Palette.Builder
extends Object


Builder class for generating Palette instances.


Public constructors

Builder(Bitmap bitmap)

Construct a new Palette.Builder using a source Bitmap

Builder(List<Palette.Swatch> swatches)

Construct a new Palette.Builder using a list of Palette.Swatch instances.

Public methods

Palette.Builder addFilter(Palette.Filter filter)

Add a filter to be able to have fine grained control over which colors are allowed in the resulting palette.

Palette.Builder addTarget(Target target)

Add a target profile to be generated in the palette.

Palette.Builder clearFilters()

Clear all added filters.

Palette.Builder clearRegion()

Clear any previously region set via setRegion(int, int, int, int).

Palette.Builder clearTargets()

Clear all added targets.

AsyncTask<Bitmap, Void, Palette> generate(Palette.PaletteAsyncListener listener)

Generate the Palette asynchronously.

Palette generate()

Generate and return the Palette synchronously.

Palette.Builder maximumColorCount(int colors)

Set the maximum number of colors to use in the quantization step when using a Bitmap as the source.

Palette.Builder resizeBitmapArea(int area)

Set the resize value when using a Bitmap as the source.