# Palette.Filter

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.Filter) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/palette#1.0.0)

*** ** * ** ***


```
public interface Palette.Filter
```

<br />

*** ** * ** ***

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`.

## Summary

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/androidx/palette/graphics/Palette.Filter#isAllowed(int,float[])(@https://developer.android.com/reference/androidx/annotation/ColorInt int rgb, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html float[] hsl)` Hook to allow clients to be able filter colors from resulting palette. |

## Public methods

### isAllowed

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

```
abstract boolean isAllowed(@ColorInt int rgb, @NonNull float[] hsl)
```

Hook to allow clients to be able filter colors from resulting palette.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int rgb` | the color in RGB888. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html float[] hsl` | HSL representation of the color. |

| Returns |
|---|---|
| `boolean` | true if the color is allowed, false if not. |

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