# Palette

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:palette-v7:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/v7/graphics/Palette#nestedclasses)\|[Methods](https://developer.android.com/reference/android/support/v7/graphics/Palette#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v7/graphics/Palette#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v7/graphics/Palette#)  

# Palette

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
Palette
`  
`

extends Object


``


`

|---|-------------------------------------|
| java.lang.Object                       ||
| ↳ | android.support.v7.graphics.Palette |

<br />

*** ** * ** ***

A helper class to extract prominent colors from an image.

A number of colors with different profiles are extracted from the image:

- Vibrant
- Vibrant Dark
- Vibrant Light
- Muted
- Muted Dark
- Muted Light

These can be retrieved from the appropriate getter method.

Instances are created with a[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)which supports several options to tweak the generated Palette. See that class' documentation for more information.

Generation should always be completed on a background thread, ideally the one in which you load your image on.[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)supports both synchronous and asynchronous generation:  

```
 // Synchronous
 Palette p = Palette.from(bitmap).generate();

 // Asynchronous
 Palette.from(bitmap).generate(new PaletteAsyncListener() {
     public void onGenerated(Palette p) {
         // Use generated instance
     }
 });
 
```

<br />

## Summary

|                                                                                                                                                                                                                                                                                                            ### Nested classes                                                                                                                                                                                                                                                                                                             ||
|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class`     | [Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder) Builder class for generating[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)instances.                                                                                                                                                                                                                                                                                                                                                                                         |
| ` interface` | [Palette.Filter](https://developer.android.com/reference/android/support/v7/graphics/Palette.Filter) A Filter provides a mechanism for exercising fine-grained control over which colors are valid within a resulting[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette).                                                                                                                                                                                                                                                                                                                |
| ` interface` | [Palette.PaletteAsyncListener](https://developer.android.com/reference/android/support/v7/graphics/Palette.PaletteAsyncListener) Listener to be used with[generateAsync(Bitmap, PaletteAsyncListener)](https://developer.android.com/reference/android/support/v7/graphics/Palette#generateAsync(android.graphics.Bitmap, android.support.v7.graphics.Palette.PaletteAsyncListener))or[generateAsync(Bitmap, int, PaletteAsyncListener)](https://developer.android.com/reference/android/support/v7/graphics/Palette#generateAsync(android.graphics.Bitmap, int, android.support.v7.graphics.Palette.PaletteAsyncListener)) |
| ` class`     | [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) Represents a color swatch generated from an image's palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)                                                                                                                                                                             | ` `[from](https://developer.android.com/reference/android/support/v7/graphics/Palette#from(java.util.List<android.support.v7.graphics.Palette.Swatch>))`(List<`[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)`> swatches) ` Generate a[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)from the pre-generated list of[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)swatches.                                                                                                                     |
| ` static `[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)                                                                                                                                                             | ` `[from](https://developer.android.com/reference/android/support/v7/graphics/Palette#from(android.graphics.Bitmap))`(`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` bitmap) ` Start generating a[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)with the returned[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)instance.                                                                                                                                                                                         |
| ` static `[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)                                                                                                                                                                             | ` `[generate](https://developer.android.com/reference/android/support/v7/graphics/Palette#generate(android.graphics.Bitmap, int))`(`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` bitmap, int numColors) ` *This method was deprecated in API level 22.1.0. Use[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)to generate the Palette.*                                                                                                                                                                                                                  |
| ` static `[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)                                                                                                                                                                             | ` `[generate](https://developer.android.com/reference/android/support/v7/graphics/Palette#generate(android.graphics.Bitmap))`(`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` bitmap) ` *This method was deprecated in API level 22.1.0. Use[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)to generate the Palette.*                                                                                                                                                                                                                                      |
| ` static `[AsyncTask](https://developer.android.com/reference/android/os/AsyncTask.html)`<`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)`, Void, `[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)`>` | ` `[generateAsync](https://developer.android.com/reference/android/support/v7/graphics/Palette#generateAsync(android.graphics.Bitmap, int, android.support.v7.graphics.Palette.PaletteAsyncListener))`(`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` bitmap, int numColors, `[Palette.PaletteAsyncListener](https://developer.android.com/reference/android/support/v7/graphics/Palette.PaletteAsyncListener)` listener) ` *This method was deprecated in API level 22.1.0. Use[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)to generate the Palette.* |
| ` static `[AsyncTask](https://developer.android.com/reference/android/os/AsyncTask.html)`<`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)`, Void, `[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)`>` | ` `[generateAsync](https://developer.android.com/reference/android/support/v7/graphics/Palette#generateAsync(android.graphics.Bitmap, android.support.v7.graphics.Palette.PaletteAsyncListener))`(`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)` bitmap, `[Palette.PaletteAsyncListener](https://developer.android.com/reference/android/support/v7/graphics/Palette.PaletteAsyncListener)` listener) ` *This method was deprecated in API level 22.1.0. Use[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)to generate the Palette.*                     |
| ` int`                                                                                                                                                                                                                                                                       | ` `[getColorForTarget](https://developer.android.com/reference/android/support/v7/graphics/Palette#getColorForTarget(android.support.v7.graphics.Target, int))`(`[Target](https://developer.android.com/reference/android/support/v7/graphics/Target)` target, int defaultColor) ` Returns the selected color for the given target from the palette as an RGB packed int.                                                                                                                                                                                                                                                                         |
| ` int`                                                                                                                                                                                                                                                                       | ` `[getDarkMutedColor](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDarkMutedColor(int))`(int defaultColor) ` Returns a muted and dark color from the palette as an RGB packed int.                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` `[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)                                                                                                                                                                      | ` `[getDarkMutedSwatch](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDarkMutedSwatch())`() ` Returns a muted and dark swatch from the palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` int`                                                                                                                                                                                                                                                                       | ` `[getDarkVibrantColor](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDarkVibrantColor(int))`(int defaultColor) ` Returns a dark and vibrant color from the palette as an RGB packed int.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` `[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)                                                                                                                                                                      | ` `[getDarkVibrantSwatch](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDarkVibrantSwatch())`() ` Returns a dark and vibrant swatch from the palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` int`                                                                                                                                                                                                                                                                       | ` `[getDominantColor](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDominantColor(int))`(int defaultColor) ` Returns the color of the dominant swatch from the palette, as an RGB packed int.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` `[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)                                                                                                                                                                      | ` `[getDominantSwatch](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDominantSwatch())`() ` Returns the dominant swatch from the palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` int`                                                                                                                                                                                                                                                                       | ` `[getLightMutedColor](https://developer.android.com/reference/android/support/v7/graphics/Palette#getLightMutedColor(int))`(int defaultColor) ` Returns a muted and light color from the palette as an RGB packed int.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` `[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)                                                                                                                                                                      | ` `[getLightMutedSwatch](https://developer.android.com/reference/android/support/v7/graphics/Palette#getLightMutedSwatch())`() ` Returns a muted and light swatch from the palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` int`                                                                                                                                                                                                                                                                       | ` `[getLightVibrantColor](https://developer.android.com/reference/android/support/v7/graphics/Palette#getLightVibrantColor(int))`(int defaultColor) ` Returns a light and vibrant color from the palette as an RGB packed int.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` `[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)                                                                                                                                                                      | ` `[getLightVibrantSwatch](https://developer.android.com/reference/android/support/v7/graphics/Palette#getLightVibrantSwatch())`() ` Returns a light and vibrant swatch from the palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` int`                                                                                                                                                                                                                                                                       | ` `[getMutedColor](https://developer.android.com/reference/android/support/v7/graphics/Palette#getMutedColor(int))`(int defaultColor) ` Returns a muted color from the palette as an RGB packed int.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` `[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)                                                                                                                                                                      | ` `[getMutedSwatch](https://developer.android.com/reference/android/support/v7/graphics/Palette#getMutedSwatch())`() ` Returns a muted swatch from the palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` `[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)                                                                                                                                                                      | ` `[getSwatchForTarget](https://developer.android.com/reference/android/support/v7/graphics/Palette#getSwatchForTarget(android.support.v7.graphics.Target))`(`[Target](https://developer.android.com/reference/android/support/v7/graphics/Target)` target) ` Returns the selected swatch for the given target from the palette, or`null`if one could not be found.                                                                                                                                                                                                                                                                               |
| ` List<`[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)`>`                                                                                                                                                              | ` `[getSwatches](https://developer.android.com/reference/android/support/v7/graphics/Palette#getSwatches())`() ` Returns all of the swatches which make up the palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` List<`[Target](https://developer.android.com/reference/android/support/v7/graphics/Target)`>`                                                                                                                                                                              | ` `[getTargets](https://developer.android.com/reference/android/support/v7/graphics/Palette#getTargets())`() ` Returns the targets used to generate this palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` int`                                                                                                                                                                                                                                                                       | ` `[getVibrantColor](https://developer.android.com/reference/android/support/v7/graphics/Palette#getVibrantColor(int))`(int defaultColor) ` Returns the most vibrant color in the palette as an RGB packed int.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` `[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)                                                                                                                                                                      | ` `[getVibrantSwatch](https://developer.android.com/reference/android/support/v7/graphics/Palette#getVibrantSwatch())`() ` Returns the most vibrant swatch in the palette.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/graphics/Palette#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public methods

### from

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette from (List<Palette.Swatch> swatches)
```

Generate a[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)from the pre-generated list of[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)swatches. This is useful for testing, or if you want to resurrect a[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)instance from a list of swatches. Will return null if the`swatches`is null.

<br />

|        Parameters         ||
|------------|---------------|
| `swatches` | `List` <br /> |

|                                            Returns                                             ||
|----------------------------------------------------------------------------------------|--------|
| [Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette) | <br /> |

### from

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Builder from (Bitmap bitmap)
```

Start generating a[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)with the returned[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)instance.

<br />

|        Parameters         ||
|----------|-----------------|
| `bitmap` | `Bitmap` <br /> |

|                                                    Returns                                                     ||
|--------------------------------------------------------------------------------------------------------|--------|
| [Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder) | <br /> |

### generate

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette generate (Bitmap bitmap, 
                int numColors)
```

<br />

**This method was deprecated in API level 22.1.0.**   
Use[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)to generate the Palette.

<br />

<br />

|          Parameters          ||
|-------------|-----------------|
| `bitmap`    | `Bitmap` <br /> |
| `numColors` | `int` <br />    |

|                                            Returns                                             ||
|----------------------------------------------------------------------------------------|--------|
| [Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette) | <br /> |

### generate

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette generate (Bitmap bitmap)
```

<br />

**This method was deprecated in API level 22.1.0.**   
Use[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)to generate the Palette.

<br />

<br />

|        Parameters         ||
|----------|-----------------|
| `bitmap` | `Bitmap` <br /> |

|                                            Returns                                             ||
|----------------------------------------------------------------------------------------|--------|
| [Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette) | <br /> |

### generateAsync

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
AsyncTask<Bitmap, Void, Palette> generateAsync (Bitmap bitmap, 
                int numColors, 
                Palette.PaletteAsyncListener listener)
```

<br />

**This method was deprecated in API level 22.1.0.**   
Use[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)to generate the Palette.

<br />

<br />

|                     Parameters                     ||
|-------------|---------------------------------------|
| `bitmap`    | `Bitmap` <br />                       |
| `numColors` | `int` <br />                          |
| `listener`  | `Palette.PaletteAsyncListener` <br /> |

|                                                                                                                                  Returns                                                                                                                                   ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [AsyncTask](https://developer.android.com/reference/android/os/AsyncTask.html)`<`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)`, Void, `[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)`>` | <br /> |

### generateAsync

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
AsyncTask<Bitmap, Void, Palette> generateAsync (Bitmap bitmap, 
                Palette.PaletteAsyncListener listener)
```

<br />

**This method was deprecated in API level 22.1.0.**   
Use[Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)to generate the Palette.

<br />

<br />

|                    Parameters                     ||
|------------|---------------------------------------|
| `bitmap`   | `Bitmap` <br />                       |
| `listener` | `Palette.PaletteAsyncListener` <br /> |

|                                                                                                                                  Returns                                                                                                                                   ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [AsyncTask](https://developer.android.com/reference/android/os/AsyncTask.html)`<`[Bitmap](https://developer.android.com/reference/android/graphics/Bitmap.html)`, Void, `[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)`>` | <br /> |

### getColorForTarget

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getColorForTarget (Target target, 
                int defaultColor)
```

Returns the selected color for the given target from the palette as an RGB packed int.

<br />

|                                 Parameters                                  ||
|----------------|-------------------------------------------------------------|
| `target`       | `Target` <br />                                             |
| `defaultColor` | `int`: value to return if the swatch isn't available <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getDarkMutedColor

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getDarkMutedColor (int defaultColor)
```

Returns a muted and dark color from the palette as an RGB packed int.

<br />

|                                 Parameters                                  ||
|----------------|-------------------------------------------------------------|
| `defaultColor` | `int`: value to return if the swatch isn't available <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [getDarkMutedSwatch()](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDarkMutedSwatch())  

### getDarkMutedSwatch

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Swatch getDarkMutedSwatch ()
```

Returns a muted and dark swatch from the palette. Might be null.

<br />

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) | <br /> |

**See also:**

- [DARK_MUTED](https://developer.android.com/reference/android/support/v7/graphics/Target#DARK_MUTED)  

### getDarkVibrantColor

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getDarkVibrantColor (int defaultColor)
```

Returns a dark and vibrant color from the palette as an RGB packed int.

<br />

|                                 Parameters                                  ||
|----------------|-------------------------------------------------------------|
| `defaultColor` | `int`: value to return if the swatch isn't available <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [getDarkVibrantSwatch()](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDarkVibrantSwatch())  

### getDarkVibrantSwatch

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Swatch getDarkVibrantSwatch ()
```

Returns a dark and vibrant swatch from the palette. Might be null.

<br />

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) | <br /> |

**See also:**

- [DARK_VIBRANT](https://developer.android.com/reference/android/support/v7/graphics/Target#DARK_VIBRANT)  

### getDominantColor

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getDominantColor (int defaultColor)
```

Returns the color of the dominant swatch from the palette, as an RGB packed int.

<br />

|                                 Parameters                                  ||
|----------------|-------------------------------------------------------------|
| `defaultColor` | `int`: value to return if the swatch isn't available <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [getDominantSwatch()](https://developer.android.com/reference/android/support/v7/graphics/Palette#getDominantSwatch())  

### getDominantSwatch

added in[version 25.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Swatch getDominantSwatch ()
```

Returns the dominant swatch from the palette.

The dominant swatch is defined as the swatch with the greatest population (frequency) within the palette.

<br />

<br />

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) | <br /> |

### getLightMutedColor

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getLightMutedColor (int defaultColor)
```

Returns a muted and light color from the palette as an RGB packed int.

<br />

|                                 Parameters                                  ||
|----------------|-------------------------------------------------------------|
| `defaultColor` | `int`: value to return if the swatch isn't available <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [getLightMutedSwatch()](https://developer.android.com/reference/android/support/v7/graphics/Palette#getLightMutedSwatch())  

### getLightMutedSwatch

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Swatch getLightMutedSwatch ()
```

Returns a muted and light swatch from the palette. Might be null.

<br />

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) | <br /> |

**See also:**

- [LIGHT_MUTED](https://developer.android.com/reference/android/support/v7/graphics/Target#LIGHT_MUTED)  

### getLightVibrantColor

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getLightVibrantColor (int defaultColor)
```

Returns a light and vibrant color from the palette as an RGB packed int.

<br />

|                                 Parameters                                  ||
|----------------|-------------------------------------------------------------|
| `defaultColor` | `int`: value to return if the swatch isn't available <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [getLightVibrantSwatch()](https://developer.android.com/reference/android/support/v7/graphics/Palette#getLightVibrantSwatch())  

### getLightVibrantSwatch

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Swatch getLightVibrantSwatch ()
```

Returns a light and vibrant swatch from the palette. Might be null.

<br />

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) | <br /> |

**See also:**

- [LIGHT_VIBRANT](https://developer.android.com/reference/android/support/v7/graphics/Target#LIGHT_VIBRANT)  

### getMutedColor

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getMutedColor (int defaultColor)
```

Returns a muted color from the palette as an RGB packed int.

<br />

|                                 Parameters                                  ||
|----------------|-------------------------------------------------------------|
| `defaultColor` | `int`: value to return if the swatch isn't available <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [getMutedSwatch()](https://developer.android.com/reference/android/support/v7/graphics/Palette#getMutedSwatch())  

### getMutedSwatch

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Swatch getMutedSwatch ()
```

Returns a muted swatch from the palette. Might be null.

<br />

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) | <br /> |

**See also:**

- [MUTED](https://developer.android.com/reference/android/support/v7/graphics/Target#MUTED)  

### getSwatchForTarget

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Swatch getSwatchForTarget (Target target)
```

Returns the selected swatch for the given target from the palette, or`null`if one could not be found.

<br />

|        Parameters         ||
|----------|-----------------|
| `target` | `Target` <br /> |

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) | <br /> |

### getSwatches

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
List<Palette.Swatch> getSwatches ()
```

Returns all of the swatches which make up the palette.

<br />

|                                                        Returns                                                         ||
|----------------------------------------------------------------------------------------------------------------|--------|
| `List<`[Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)`>` | <br /> |

### getTargets

added in[version 24.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
List<Target> getTargets ()
```

Returns the targets used to generate this palette.

<br />

|                                                Returns                                                 ||
|------------------------------------------------------------------------------------------------|--------|
| `List<`[Target](https://developer.android.com/reference/android/support/v7/graphics/Target)`>` | <br /> |

### getVibrantColor

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getVibrantColor (int defaultColor)
```

Returns the most vibrant color in the palette as an RGB packed int.

<br />

|                                 Parameters                                  ||
|----------------|-------------------------------------------------------------|
| `defaultColor` | `int`: value to return if the swatch isn't available <br /> |

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [getVibrantSwatch()](https://developer.android.com/reference/android/support/v7/graphics/Palette#getVibrantSwatch())  

### getVibrantSwatch

added in[version 22.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Palette.Swatch getVibrantSwatch ()
```

Returns the most vibrant swatch in the palette. Might be null.

<br />

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch) | <br /> |

**See also:**

- [VIBRANT](https://developer.android.com/reference/android/support/v7/graphics/Target#VIBRANT)  
-

  ## Interfaces

  - [Palette.Filter](https://developer.android.com/reference/android/support/v7/graphics/Palette.Filter)
  - [Palette.PaletteAsyncListener](https://developer.android.com/reference/android/support/v7/graphics/Palette.PaletteAsyncListener)
-

  ## Classes

  - [Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)
  - [Palette.Builder](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder)
  - [Palette.Swatch](https://developer.android.com/reference/android/support/v7/graphics/Palette.Swatch)
  - [Target](https://developer.android.com/reference/android/support/v7/graphics/Target)
  - [Target.Builder](https://developer.android.com/reference/android/support/v7/graphics/Target.Builder)