# Palette

Artifact: [androidx.palette:palette](https://developer.android.com/jetpack/androidx/releases/palette) [View Source](https://cs.android.com/search?q=file:androidx/palette/graphics/Palette.java+class:androidx.palette.graphics.Palette) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

*** ** * ** ***


```
class 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 `https://developer.android.com/reference/kotlin/androidx/palette/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. `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette.Builder` supports both synchronous and asynchronous generation:

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

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

## Summary

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

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

| ### Extension functions |
|---|---|
| `inline operator https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette.Swatch?` | `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette.https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#(androidx.palette.graphics.Palette).get(androidx.palette.graphics.Target)(target: https://developer.android.com/reference/kotlin/androidx/palette/graphics/Target)` Returns the selected swatch for the given target from the palette, or `null` if one could not be found. |

## Public functions

### from

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
java-static fun from(bitmap: Bitmap): Palette.Builder
```

Start generating a `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette` with the returned `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette.Builder` instance.

### from

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
java-static fun from(swatches: (Mutable)List<Palette.Swatch!>): Palette
```

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

### generate

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
java-static fun [generate](https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#generate(android.graphics.Bitmap))(bitmap: Bitmap): Palette
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette.Builder` to generate the Palette.

### generate

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
java-static fun [generate](https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#generate(android.graphics.Bitmap,int))(bitmap: Bitmap, numColors: Int): Palette
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette.Builder` to generate the Palette.

### generateAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
java-static fun [generateAsync](https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#generateAsync(android.graphics.Bitmap,androidx.palette.graphics.Palette.PaletteAsyncListener))(bitmap: Bitmap, listener: Palette.PaletteAsyncListener): AsyncTask<Bitmap!, Void!, Palette!>
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette.Builder` to generate the Palette.

### generateAsync

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
java-static fun [generateAsync](https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#generateAsync(android.graphics.Bitmap,int,androidx.palette.graphics.Palette.PaletteAsyncListener))(
    bitmap: Bitmap,
    numColors: Int,
    listener: Palette.PaletteAsyncListener
): AsyncTask<Bitmap!, Void!, Palette!>
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette.Builder` to generate the Palette.

### getColorForTarget

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getColorForTarget(target: Target, defaultColor: @ColorInt Int): @ColorInt Int
```

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

| Parameters |
|---|---|
| `target: https://developer.android.com/reference/kotlin/androidx/palette/graphics/Target` | target that describes the properties of the color |
| `defaultColor: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | value to return if the swatch isn't available |

### getDarkMutedColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getDarkMutedColor(defaultColor: @ColorInt Int): @ColorInt Int
```

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

| Parameters |
|---|---|
| `defaultColor: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | value to return if the swatch isn't available |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#getDarkMutedSwatch()` |   |

### getDarkMutedSwatch

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getDarkMutedSwatch(): Palette.Swatch?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Target#DARK_MUTED()` |   |

### getDarkVibrantColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getDarkVibrantColor(defaultColor: @ColorInt Int): @ColorInt Int
```

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

| Parameters |
|---|---|
| `defaultColor: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | value to return if the swatch isn't available |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#getDarkVibrantSwatch()` |   |

### getDarkVibrantSwatch

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getDarkVibrantSwatch(): Palette.Swatch?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Target#DARK_VIBRANT()` |   |

### getDominantColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getDominantColor(defaultColor: @ColorInt Int): @ColorInt Int
```

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

| Parameters |
|---|---|
| `defaultColor: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | value to return if the swatch isn't available |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#getDominantSwatch()` |   |

### getDominantSwatch

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getDominantSwatch(): Palette.Swatch?
```

Returns the dominant swatch from the palette.

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

### getLightMutedColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getLightMutedColor(defaultColor: @ColorInt Int): @ColorInt Int
```

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

| Parameters |
|---|---|
| `defaultColor: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | value to return if the swatch isn't available |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#getLightMutedSwatch()` |   |

### getLightMutedSwatch

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getLightMutedSwatch(): Palette.Swatch?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Target#LIGHT_MUTED()` |   |

### getLightVibrantColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getLightVibrantColor(defaultColor: @ColorInt Int): @ColorInt Int
```

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

| Parameters |
|---|---|
| `defaultColor: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | value to return if the swatch isn't available |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#getLightVibrantSwatch()` |   |

### getLightVibrantSwatch

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getLightVibrantSwatch(): Palette.Swatch?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Target#LIGHT_VIBRANT()` |   |

### getMutedColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getMutedColor(defaultColor: @ColorInt Int): @ColorInt Int
```

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

| Parameters |
|---|---|
| `defaultColor: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | value to return if the swatch isn't available |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#getMutedSwatch()` |   |

### getMutedSwatch

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getMutedSwatch(): Palette.Swatch?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Target#MUTED()` |   |

### getSwatchForTarget

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getSwatchForTarget(target: Target): Palette.Swatch?
```

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

### getSwatches

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getSwatches(): (Mutable)List<Palette.Swatch!>
```

Returns all of the swatches which make up the palette.

### getTargets

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getTargets(): (Mutable)List<Target!>
```

Returns the targets used to generate this palette.

### getVibrantColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getVibrantColor(defaultColor: @ColorInt Int): @ColorInt Int
```

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

| Parameters |
|---|---|
| `defaultColor: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | value to return if the swatch isn't available |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#getVibrantSwatch()` |   |

### getVibrantSwatch

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

```
fun getVibrantSwatch(): Palette.Swatch?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Target#VIBRANT()` |   |

## Extension functions

### Palette.get

Artifact: [androidx.palette:palette](https://developer.android.com/jetpack/androidx/releases/palette) [View Source](https://cs.android.com/search?q=file:androidx/palette/graphics/Palette.kt+function:get)

```
inline operator fun Palette.get(target: Target): Palette.Swatch?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/palette/graphics/Palette#getSwatchForTarget(androidx.palette.graphics.Target)` |   |