Target.Builder
public final class Target.Builder
Builder class for generating custom Target instances.
Summary
Public constructors |
|---|
Builder()Create a new |
|
Create a new builder based on an existing |
Public methods |
|
|---|---|
@NonNull Target |
build()Builds and returns the resulting |
@NonNull Target.Builder |
setExclusive(boolean exclusive)Set whether any color selected for this target is exclusive to this target only. |
@NonNull Target.Builder |
setLightnessWeight(@FloatRange(from = 0) float weight)Set the weight of importance that this target will place on lightness values. |
@NonNull Target.Builder |
setMaximumLightness(@FloatRange(from = 0, to = 1) float value)Set the maximum lightness value for this target. |
@NonNull Target.Builder |
setMaximumSaturation(@FloatRange(from = 0, to = 1) float value)Set the maximum saturation value for this target. |
@NonNull Target.Builder |
setMinimumLightness(@FloatRange(from = 0, to = 1) float value)Set the minimum lightness value for this target. |
@NonNull Target.Builder |
setMinimumSaturation(@FloatRange(from = 0, to = 1) float value)Set the minimum saturation value for this target. |
@NonNull Target.Builder |
setPopulationWeight(@FloatRange(from = 0) float weight)Set the weight of importance that this target will place on a color's population within the image. |
@NonNull Target.Builder |
setSaturationWeight(@FloatRange(from = 0) float weight)Set the weight of importance that this target will place on saturation values. |
@NonNull Target.Builder |
setTargetLightness(@FloatRange(from = 0, to = 1) float value)Set the target/ideal lightness value for this target. |
@NonNull Target.Builder |
setTargetSaturation(@FloatRange(from = 0, to = 1) float value)Set the target/ideal saturation value for this target. |
Public constructors
Public methods
setExclusive
public @NonNull Target.Builder setExclusive(boolean exclusive)
Set whether any color selected for this target is exclusive to this target only. Defaults to true.
| Parameters | |
|---|---|
boolean exclusive |
true if any the color is exclusive to this target, or false is the color can be selected for other targets. |
setLightnessWeight
public @NonNull Target.Builder setLightnessWeight(@FloatRange(from = 0) 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 | |
|---|---|
setTargetLightness |
setMaximumLightness
public @NonNull Target.Builder setMaximumLightness(@FloatRange(from = 0, to = 1) float value)
Set the maximum lightness value for this target.
setMaximumSaturation
public @NonNull Target.Builder setMaximumSaturation(@FloatRange(from = 0, to = 1) float value)
Set the maximum saturation value for this target.
setMinimumLightness
public @NonNull Target.Builder setMinimumLightness(@FloatRange(from = 0, to = 1) float value)
Set the minimum lightness value for this target.
setMinimumSaturation
public @NonNull Target.Builder setMinimumSaturation(@FloatRange(from = 0, to = 1) float value)
Set the minimum saturation value for this target.
setPopulationWeight
public @NonNull Target.Builder setPopulationWeight(@FloatRange(from = 0) 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.
setSaturationWeight
public @NonNull Target.Builder setSaturationWeight(@FloatRange(from = 0) 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 | |
|---|---|
setTargetSaturation |
setTargetLightness
public @NonNull Target.Builder setTargetLightness(@FloatRange(from = 0, to = 1) float value)
Set the target/ideal lightness value for this target.
setTargetSaturation
public @NonNull Target.Builder setTargetSaturation(@FloatRange(from = 0, to = 1) float value)
Set the target/ideal saturation value for this target.