Skip to content

Most visited

Recently visited

navigation

Target.Builder

public static final class Target.Builder
extends Object

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


Builder class for generating custom Target instances.

Summary

Public constructors

Target.Builder()

Create a new Target builder from scratch.

Target.Builder(Target target)

Create a new builder based on an existing Target.

Public methods

Target build()

Builds and returns the resulting Target.

Target.Builder setExclusive(boolean exclusive)

Set whether any color selected for this target is exclusive to this target only.

Target.Builder setLightnessWeight(float weight)

Set the weight of importance that this target will place on lightness values.

Target.Builder setMaximumLightness(float value)

Set the maximum lightness value for this target.

Target.Builder setMaximumSaturation(float value)

Set the maximum saturation value for this target.

Target.Builder setMinimumLightness(float value)

Set the minimum lightness value for this target.

Target.Builder setMinimumSaturation(float value)

Set the minimum saturation value for this target.

Target.Builder setPopulationWeight(float weight)

Set the weight of importance that this target will place on a color's population within the image.

Target.Builder setSaturationWeight(float weight)

Set the weight of importance that this target will place on saturation values.

Target.Builder setTargetLightness(float value)

Set the target/ideal lightness value for this target.

Target.Builder setTargetSaturation(float value)

Set the target/ideal saturation value for this target.

Inherited methods

From class java.lang.Object

Public constructors

Target.Builder

added in version 23.2.0
Target.Builder ()

Create a new Target builder from scratch.

Target.Builder

added in version 23.2.0
Target.Builder (Target target)

Create a new builder based on an existing Target.

Parameters
target Target

Public methods

build

added in version 23.2.0
Target build ()

Builds and returns the resulting Target.

Returns
Target

setExclusive

added in version 23.2.0
Target.Builder setExclusive (boolean exclusive)

Set whether any color selected for this target is exclusive to this target only. Defaults to true.

Parameters
exclusive boolean: true if any the color is exclusive to this target, or false is the color can be selected for other targets.

Returns
Target.Builder

setLightnessWeight

added in version 23.2.0
Target.Builder setLightnessWeight (float weight)

Set the weight of importance that this target will place on lightness values.

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

A weight of 0 means that it has no weight, and thus has no bearing on the selection.

Parameters
weight float

Value is 0.0 or greater.

Returns
Target.Builder

See also:

setMaximumLightness

added in version 23.2.0
Target.Builder setMaximumLightness (float value)

Set the maximum lightness value for this target.

Parameters
value float

Value is between 0.0 and 1.0 inclusive.

Returns
Target.Builder

setMaximumSaturation

added in version 23.2.0
Target.Builder setMaximumSaturation (float value)

Set the maximum saturation value for this target.

Parameters
value float

Value is between 0.0 and 1.0 inclusive.

Returns
Target.Builder

setMinimumLightness

added in version 23.2.0
Target.Builder setMinimumLightness (float value)

Set the minimum lightness value for this target.

Parameters
value float

Value is between 0.0 and 1.0 inclusive.

Returns
Target.Builder

setMinimumSaturation

added in version 23.2.0
Target.Builder setMinimumSaturation (float value)

Set the minimum saturation value for this target.

Parameters
value float

Value is between 0.0 and 1.0 inclusive.

Returns
Target.Builder

setPopulationWeight

added in version 23.2.0
Target.Builder setPopulationWeight (float weight)

Set the weight of importance that this target will place 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.

A weight of 0 means that it has no weight, and thus has no bearing on the selection.

Parameters
weight float

Value is 0.0 or greater.

Returns
Target.Builder

setSaturationWeight

added in version 23.2.0
Target.Builder setSaturationWeight (float weight)

Set the weight of importance that this target will place on saturation values.

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

A weight of 0 means that it has no weight, and thus has no bearing on the selection.

Parameters
weight float

Value is 0.0 or greater.

Returns
Target.Builder

See also:

setTargetLightness

added in version 23.2.0
Target.Builder setTargetLightness (float value)

Set the target/ideal lightness value for this target.

Parameters
value float

Value is between 0.0 and 1.0 inclusive.

Returns
Target.Builder

setTargetSaturation

added in version 23.2.0
Target.Builder setTargetSaturation (float value)

Set the target/ideal saturation value for this target.

Parameters
value float

Value is between 0.0 and 1.0 inclusive.

Returns
Target.Builder

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!

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)