public final class

Target.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.palette.graphics.Target.Builder

Overview

Builder class for generating custom Target instances.

Summary

Constructors
publicBuilder()

Create a new Target builder from scratch.

publicBuilder(Target target)

Create a new builder based on an existing Target.

Methods
public Targetbuild()

Builds and returns the resulting Target.

public Target.BuildersetExclusive(boolean exclusive)

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

public Target.BuildersetLightnessWeight(float weight)

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

public Target.BuildersetMaximumLightness(float value)

Set the maximum lightness value for this target.

public Target.BuildersetMaximumSaturation(float value)

Set the maximum saturation value for this target.

public Target.BuildersetMinimumLightness(float value)

Set the minimum lightness value for this target.

public Target.BuildersetMinimumSaturation(float value)

Set the minimum saturation value for this target.

public Target.BuildersetPopulationWeight(float weight)

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

public Target.BuildersetSaturationWeight(float weight)

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

public Target.BuildersetTargetLightness(float value)

Set the target/ideal lightness value for this target.

public Target.BuildersetTargetSaturation(float value)

Set the target/ideal saturation value for this target.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Create a new Target builder from scratch.

public Builder(Target target)

Create a new builder based on an existing Target.

Methods

public Target.Builder setMinimumSaturation(float value)

Set the minimum saturation value for this target.

public Target.Builder setTargetSaturation(float value)

Set the target/ideal saturation value for this target.

public Target.Builder setMaximumSaturation(float value)

Set the maximum saturation value for this target.

public Target.Builder setMinimumLightness(float value)

Set the minimum lightness value for this target.

public Target.Builder setTargetLightness(float value)

Set the target/ideal lightness value for this target.

public Target.Builder setMaximumLightness(float value)

Set the maximum lightness value for this target.

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

See also: Target.Builder.setTargetSaturation(float)

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

See also: Target.Builder.setTargetLightness(float)

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

public Target.Builder setExclusive(boolean exclusive)

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

Parameters:

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

public Target build()

Builds and returns the resulting Target.