# Target

added in[version 24.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/Target#nestedclasses)\|[Fields](https://developer.android.com/reference/android/support/v7/graphics/Target#lfields)\|[Methods](https://developer.android.com/reference/android/support/v7/graphics/Target#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/v7/graphics/Target#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/v7/graphics/Target#)  

# Target

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

extends Object


``


`

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

<br />

*** ** * ** ***

A class which allows custom selection of colors in a[Palette](https://developer.android.com/reference/android/support/v7/graphics/Palette)'s generation. Instances can be created via the[Target.Builder](https://developer.android.com/reference/android/support/v7/graphics/Target.Builder)class.

To use the target, use the[addTarget(Target)](https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder#addTarget(android.support.v7.graphics.Target))API when building a Palette.

<br />

## Summary

|                                                                                                                ### Nested classes                                                                                                                ||
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [Target.Builder](https://developer.android.com/reference/android/support/v7/graphics/Target.Builder) Builder class for generating custom[Target](https://developer.android.com/reference/android/support/v7/graphics/Target)instances. |

|                                                                                                                                                  ### Fields                                                                                                                                                   ||
|-------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public static final `[Target](https://developer.android.com/reference/android/support/v7/graphics/Target) | [DARK_MUTED](https://developer.android.com/reference/android/support/v7/graphics/Target#DARK_MUTED) A target which has the characteristics of a muted color which is dark in luminance.          |
| ` public static final `[Target](https://developer.android.com/reference/android/support/v7/graphics/Target) | [DARK_VIBRANT](https://developer.android.com/reference/android/support/v7/graphics/Target#DARK_VIBRANT) A target which has the characteristics of a vibrant color which is dark in luminance.    |
| ` public static final `[Target](https://developer.android.com/reference/android/support/v7/graphics/Target) | [LIGHT_MUTED](https://developer.android.com/reference/android/support/v7/graphics/Target#LIGHT_MUTED) A target which has the characteristics of a muted color which is light in luminance.       |
| ` public static final `[Target](https://developer.android.com/reference/android/support/v7/graphics/Target) | [LIGHT_VIBRANT](https://developer.android.com/reference/android/support/v7/graphics/Target#LIGHT_VIBRANT) A target which has the characteristics of a vibrant color which is light in luminance. |
| ` public static final `[Target](https://developer.android.com/reference/android/support/v7/graphics/Target) | [MUTED](https://developer.android.com/reference/android/support/v7/graphics/Target#MUTED) A target which has the characteristics of a muted color which is neither light or dark.                |
| ` public static final `[Target](https://developer.android.com/reference/android/support/v7/graphics/Target) | [VIBRANT](https://developer.android.com/reference/android/support/v7/graphics/Target#VIBRANT) A target which has the characteristics of a vibrant color which is neither light or dark.          |

|                                                                                                               ### Public methods                                                                                                               ||
|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` float`   | ` `[getLightnessWeight](https://developer.android.com/reference/android/support/v7/graphics/Target#getLightnessWeight())`() ` Returns the weight of importance that this target places on a color's lightness within the image.    |
| ` float`   | ` `[getMaximumLightness](https://developer.android.com/reference/android/support/v7/graphics/Target#getMaximumLightness())`() ` The maximum lightness value for this target.                                                       |
| ` float`   | ` `[getMaximumSaturation](https://developer.android.com/reference/android/support/v7/graphics/Target#getMaximumSaturation())`() ` The maximum saturation value for this target.                                                    |
| ` float`   | ` `[getMinimumLightness](https://developer.android.com/reference/android/support/v7/graphics/Target#getMinimumLightness())`() ` The minimum lightness value for this target.                                                       |
| ` float`   | ` `[getMinimumSaturation](https://developer.android.com/reference/android/support/v7/graphics/Target#getMinimumSaturation())`() ` The minimum saturation value for this target.                                                    |
| ` float`   | ` `[getPopulationWeight](https://developer.android.com/reference/android/support/v7/graphics/Target#getPopulationWeight())`() ` Returns the weight of importance that this target places on a color's population within the image. |
| ` float`   | ` `[getSaturationWeight](https://developer.android.com/reference/android/support/v7/graphics/Target#getSaturationWeight())`() ` Returns the weight of importance that this target places on a color's saturation within the image. |
| ` float`   | ` `[getTargetLightness](https://developer.android.com/reference/android/support/v7/graphics/Target#getTargetLightness())`() ` The target lightness value for this target.                                                          |
| ` float`   | ` `[getTargetSaturation](https://developer.android.com/reference/android/support/v7/graphics/Target#getTargetSaturation())`() ` The target saturation value for this target.                                                       |
| ` boolean` | ` `[isExclusive](https://developer.android.com/reference/android/support/v7/graphics/Target#isExclusive())`() ` Returns whether any color selected for this target is exclusive for this target only.                              |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/v7/graphics/Target#)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() `                    | ||

## Fields

### DARK_MUTED

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

```
Target DARK_MUTED
```

A target which has the characteristics of a muted color which is dark in luminance.

<br />

### DARK_VIBRANT

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

```
Target DARK_VIBRANT
```

A target which has the characteristics of a vibrant color which is dark in luminance.

<br />

### LIGHT_MUTED

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

```
Target LIGHT_MUTED
```

A target which has the characteristics of a muted color which is light in luminance.

<br />

### LIGHT_VIBRANT

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

```
Target LIGHT_VIBRANT
```

A target which has the characteristics of a vibrant color which is light in luminance.

<br />

### MUTED

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

```
Target MUTED
```

A target which has the characteristics of a muted color which is neither light or dark.

<br />

### VIBRANT

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

```
Target VIBRANT
```

A target which has the characteristics of a vibrant color which is neither light or dark.

<br />

## Public methods

### getLightnessWeight

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

```
float getLightnessWeight ()
```

Returns the weight of importance that this target places on a color's lightness within the image.

The larger the weight, relative to the other weights, the more important that a color being close to the target value has on selection.

<br />

<br />

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

**See also:**

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

### getMaximumLightness

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

```
float getMaximumLightness ()
```

The maximum lightness value for this target.

<br />

|                     Returns                      ||
|---------|-----------------------------------------|
| `float` | Value is between 0.0 and 1.0 inclusive. |

### getMaximumSaturation

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

```
float getMaximumSaturation ()
```

The maximum saturation value for this target.

<br />

|                     Returns                      ||
|---------|-----------------------------------------|
| `float` | Value is between 0.0 and 1.0 inclusive. |

### getMinimumLightness

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

```
float getMinimumLightness ()
```

The minimum lightness value for this target.

<br />

|                     Returns                      ||
|---------|-----------------------------------------|
| `float` | Value is between 0.0 and 1.0 inclusive. |

### getMinimumSaturation

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

```
float getMinimumSaturation ()
```

The minimum saturation value for this target.

<br />

|                     Returns                      ||
|---------|-----------------------------------------|
| `float` | Value is between 0.0 and 1.0 inclusive. |

### getPopulationWeight

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

```
float getPopulationWeight ()
```

Returns the weight of importance that this target places on a color's population within the image.

The larger the weight, relative to the other weights, the more important that a color's population being close to the most populous has on selection.

<br />

<br />

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

### getSaturationWeight

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

```
float getSaturationWeight ()
```

Returns the weight of importance that this target places on a color's saturation within the image.

The larger the weight, relative to the other weights, the more important that a color being close to the target value has on selection.

<br />

<br />

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

**See also:**

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

### getTargetLightness

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

```
float getTargetLightness ()
```

The target lightness value for this target.

<br />

|                     Returns                      ||
|---------|-----------------------------------------|
| `float` | Value is between 0.0 and 1.0 inclusive. |

### getTargetSaturation

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

```
float getTargetSaturation ()
```

The target saturation value for this target.

<br />

|                     Returns                      ||
|---------|-----------------------------------------|
| `float` | Value is between 0.0 and 1.0 inclusive. |

### isExclusive

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

```
boolean isExclusive ()
```

Returns whether any color selected for this target is exclusive for this target only.

If false, then the color can be selected for other targets.

<br />

<br />

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

-

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