Skip to content

Most visited

Recently visited

navigation
added in version 24.1.0
belongs to Maven artifact com.android.support:palette-v7:27.0.0

Target

public final class Target
extends Object

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


A class which allows custom selection of colors in a Palette's generation. Instances can be created via the Target.Builder class.

To use the target, use the addTarget(Target) API when building a Palette.

Summary

Nested classes

class Target.Builder

Builder class for generating custom Target instances. 

Fields

public static final Target DARK_MUTED

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

public static final Target DARK_VIBRANT

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

public static final Target LIGHT_MUTED

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

public static final Target LIGHT_VIBRANT

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

public static final Target MUTED

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

public static final Target VIBRANT

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

Public methods

float getLightnessWeight()

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

float getMaximumLightness()

The maximum lightness value for this target.

float getMaximumSaturation()

The maximum saturation value for this target.

float getMinimumLightness()

The minimum lightness value for this target.

float getMinimumSaturation()

The minimum saturation value for this target.

float getPopulationWeight()

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

float getSaturationWeight()

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

float getTargetLightness()

The target lightness value for this target.

float getTargetSaturation()

The target saturation value for this target.

boolean isExclusive()

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

Inherited methods

From class java.lang.Object

Fields

DARK_MUTED

added in version 24.1.0
Target DARK_MUTED

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

DARK_VIBRANT

added in version 24.1.0
Target DARK_VIBRANT

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

LIGHT_MUTED

added in version 24.1.0
Target LIGHT_MUTED

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

LIGHT_VIBRANT

added in version 24.1.0
Target LIGHT_VIBRANT

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

MUTED

added in version 24.1.0
Target MUTED

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

VIBRANT

added in version 24.1.0
Target VIBRANT

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

Public methods

getLightnessWeight

added in version 24.1.0
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.

Returns
float

See also:

getMaximumLightness

added in version 24.1.0
float getMaximumLightness ()

The maximum lightness value for this target.

Returns
float

Value is between 0.0 and 1.0 inclusive.

getMaximumSaturation

added in version 24.1.0
float getMaximumSaturation ()

The maximum saturation value for this target.

Returns
float

Value is between 0.0 and 1.0 inclusive.

getMinimumLightness

added in version 24.1.0
float getMinimumLightness ()

The minimum lightness value for this target.

Returns
float

Value is between 0.0 and 1.0 inclusive.

getMinimumSaturation

added in version 24.1.0
float getMinimumSaturation ()

The minimum saturation value for this target.

Returns
float

Value is between 0.0 and 1.0 inclusive.

getPopulationWeight

added in version 24.1.0
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.

Returns
float

getSaturationWeight

added in version 24.1.0
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.

Returns
float

See also:

getTargetLightness

added in version 24.1.0
float getTargetLightness ()

The target lightness value for this target.

Returns
float

Value is between 0.0 and 1.0 inclusive.

getTargetSaturation

added in version 24.1.0
float getTargetSaturation ()

The target saturation value for this target.

Returns
float

Value is between 0.0 and 1.0 inclusive.

isExclusive

added in version 24.1.0
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.

Returns
boolean

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)