Target.Builder

class Target.Builder


Builder class for generating custom Target instances.

Summary

Public constructors

Create a new Target builder from scratch.

Builder(target: Target)

Create a new builder based on an existing Target.

Public functions

Target

Builds and returns the resulting Target.

Target.Builder
setExclusive(exclusive: Boolean)

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

Target.Builder
setLightnessWeight(weight: @FloatRange(from = 0) Float)

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

Target.Builder
setMaximumLightness(value: @FloatRange(from = 0, to = 1) Float)

Set the maximum lightness value for this target.

Target.Builder
setMaximumSaturation(value: @FloatRange(from = 0, to = 1) Float)

Set the maximum saturation value for this target.

Target.Builder
setMinimumLightness(value: @FloatRange(from = 0, to = 1) Float)

Set the minimum lightness value for this target.

Target.Builder
setMinimumSaturation(value: @FloatRange(from = 0, to = 1) Float)

Set the minimum saturation value for this target.

Target.Builder
setPopulationWeight(weight: @FloatRange(from = 0) Float)

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

Target.Builder
setSaturationWeight(weight: @FloatRange(from = 0) Float)

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

Target.Builder
setTargetLightness(value: @FloatRange(from = 0, to = 1) Float)

Set the target/ideal lightness value for this target.

Target.Builder
setTargetSaturation(value: @FloatRange(from = 0, to = 1) Float)

Set the target/ideal saturation value for this target.

Public constructors

Builder

Added in 1.0.0
Builder()

Create a new Target builder from scratch.

Builder

Added in 1.0.0
Builder(target: Target)

Create a new builder based on an existing Target.

Public functions

build

Added in 1.0.0
fun build(): Target

Builds and returns the resulting Target.

setExclusive

Added in 1.0.0
fun setExclusive(exclusive: Boolean): Target.Builder

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.

setLightnessWeight

Added in 1.0.0
fun setLightnessWeight(weight: @FloatRange(from = 0) Float): Target.Builder

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.

setMaximumLightness

Added in 1.0.0
fun setMaximumLightness(value: @FloatRange(from = 0, to = 1) Float): Target.Builder

Set the maximum lightness value for this target.

setMaximumSaturation

Added in 1.0.0
fun setMaximumSaturation(value: @FloatRange(from = 0, to = 1) Float): Target.Builder

Set the maximum saturation value for this target.

setMinimumLightness

Added in 1.0.0
fun setMinimumLightness(value: @FloatRange(from = 0, to = 1) Float): Target.Builder

Set the minimum lightness value for this target.

setMinimumSaturation

Added in 1.0.0
fun setMinimumSaturation(value: @FloatRange(from = 0, to = 1) Float): Target.Builder

Set the minimum saturation value for this target.

setPopulationWeight

Added in 1.0.0
fun setPopulationWeight(weight: @FloatRange(from = 0) Float): Target.Builder

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

Added in 1.0.0
fun setSaturationWeight(weight: @FloatRange(from = 0) Float): Target.Builder

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.

setTargetLightness

Added in 1.0.0
fun setTargetLightness(value: @FloatRange(from = 0, to = 1) Float): Target.Builder

Set the target/ideal lightness value for this target.

setTargetSaturation

Added in 1.0.0
fun setTargetSaturation(value: @FloatRange(from = 0, to = 1) Float): Target.Builder

Set the target/ideal saturation value for this target.