# 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)

*** ** * ** ***


```
public final 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/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/androidx/palette/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
    }
});
```

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/palette/graphics/Palette.Builder` Builder class for generating `https://developer.android.com/reference/androidx/palette/graphics/Palette` instances. |
| `public interface https://developer.android.com/reference/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/androidx/palette/graphics/Palette`. |
| `public interface https://developer.android.com/reference/androidx/palette/graphics/Palette.PaletteAsyncListener` Listener to be used with `https://developer.android.com/reference/androidx/palette/graphics/Palette#generateAsync(android.graphics.Bitmap,androidx.palette.graphics.Palette.PaletteAsyncListener)` or `https://developer.android.com/reference/androidx/palette/graphics/Palette#generateAsync(android.graphics.Bitmap,int,androidx.palette.graphics.Palette.PaletteAsyncListener)` |
| `public final class https://developer.android.com/reference/androidx/palette/graphics/Palette.Swatch` Represents a color swatch generated from an image's palette. |

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

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

## Public methods

### from

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

```
public static @NonNull Palette.Builder from(@NonNull Bitmap bitmap)
```

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

### from

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

```
public static @NonNull Palette from(@NonNull List<Palette.Swatch> swatches)
```

Generate a `https://developer.android.com/reference/androidx/palette/graphics/Palette` from the pre-generated list of `https://developer.android.com/reference/androidx/palette/graphics/Palette.Swatch` swatches. This is useful for testing, or if you want to resurrect a `https://developer.android.com/reference/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)

```
public static @NonNull Palette [generate](https://developer.android.com/reference/androidx/palette/graphics/Palette#generate(android.graphics.Bitmap))(@NonNull Bitmap bitmap)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/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)

```
public static @NonNull Palette [generate](https://developer.android.com/reference/androidx/palette/graphics/Palette#generate(android.graphics.Bitmap,int))(@NonNull Bitmap bitmap, int numColors)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/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)

```
public static @NonNull AsyncTask<Bitmap, Void, Palette> [generateAsync](https://developer.android.com/reference/androidx/palette/graphics/Palette#generateAsync(android.graphics.Bitmap,androidx.palette.graphics.Palette.PaletteAsyncListener))(
    @NonNull Bitmap bitmap,
    @NonNull Palette.PaletteAsyncListener listener
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/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)

```
public static @NonNull AsyncTask<Bitmap, Void, Palette> [generateAsync](https://developer.android.com/reference/androidx/palette/graphics/Palette#generateAsync(android.graphics.Bitmap,int,androidx.palette.graphics.Palette.PaletteAsyncListener))(
    @NonNull Bitmap bitmap,
    int numColors,
    @NonNull Palette.PaletteAsyncListener listener
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/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)

```
public @ColorInt int getColorForTarget(@NonNull Target target, @ColorInt int defaultColor)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/palette/graphics/Target target` | target that describes the properties of the color |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int defaultColor` | 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)

```
public @ColorInt int getDarkMutedColor(@ColorInt int defaultColor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int defaultColor` | value to return if the swatch isn't available |

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

### getDarkMutedSwatch

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

```
public @Nullable Palette.Swatch getDarkMutedSwatch()
```

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

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

### getDarkVibrantColor

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

```
public @ColorInt int getDarkVibrantColor(@ColorInt int defaultColor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int defaultColor` | value to return if the swatch isn't available |

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

### getDarkVibrantSwatch

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

```
public @Nullable Palette.Swatch getDarkVibrantSwatch()
```

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

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

### getDominantColor

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

```
public @ColorInt int getDominantColor(@ColorInt int defaultColor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int defaultColor` | value to return if the swatch isn't available |

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

### getDominantSwatch

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

```
public @Nullable 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.

### getLightMutedColor

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

```
public @ColorInt int getLightMutedColor(@ColorInt int defaultColor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int defaultColor` | value to return if the swatch isn't available |

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

### getLightMutedSwatch

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

```
public @Nullable Palette.Swatch getLightMutedSwatch()
```

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

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

### getLightVibrantColor

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

```
public @ColorInt int getLightVibrantColor(@ColorInt int defaultColor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int defaultColor` | value to return if the swatch isn't available |

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

### getLightVibrantSwatch

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

```
public @Nullable Palette.Swatch getLightVibrantSwatch()
```

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

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

### getMutedColor

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

```
public @ColorInt int getMutedColor(@ColorInt int defaultColor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int defaultColor` | value to return if the swatch isn't available |

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

### getMutedSwatch

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

```
public @Nullable Palette.Swatch getMutedSwatch()
```

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

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

### getSwatchForTarget

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

```
public @Nullable Palette.Swatch getSwatchForTarget(@NonNull Target target)
```

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)

```
public @NonNull List<Palette.Swatch> getSwatches()
```

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)

```
public @NonNull List<Target> getTargets()
```

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)

```
public @ColorInt int getVibrantColor(@ColorInt int defaultColor)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int defaultColor` | value to return if the swatch isn't available |

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

### getVibrantSwatch

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

```
public @Nullable Palette.Swatch getVibrantSwatch()
```

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

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

## Extension functions

### PaletteKt.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)

```
public final Palette.Swatch PaletteKt.get(@NonNull Palette receiver, @NonNull Target target)
```

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/androidx/palette/graphics/Palette#getSwatchForTarget(androidx.palette.graphics.Target)` |   |