Builder
class Builder
kotlin.Any | |
↳ | androidx.palette.graphics.Target.Builder |
Builder class for generating custom Target
instances.
Summary
Public constructors | |
---|---|
<init>() Create a new |
|
Create a new builder based on an existing |
Public methods | |
---|---|
Target.Builder |
setMinimumLightness(value: Float) Set the minimum lightness value for this target. |
Target.Builder |
setTargetSaturation(value: Float) Set the target/ideal saturation value for this target. |
Target.Builder |
setMaximumSaturation(value: Float) Set the maximum saturation value for this target. |
Target.Builder |
setMaximumLightness(value: Float) Set the maximum lightness value for this target. |
Target |
build() Builds and returns the resulting |
Target.Builder |
setExclusive(exclusive: Boolean) Set whether any color selected for this target is exclusive to this target only. |
Target.Builder |
setPopulationWeight(weight: Float) Set the weight of importance that this target will place on a color's population within the image. |
Target.Builder |
setMinimumSaturation(value: Float) Set the minimum saturation value for this target. |
Target.Builder |
setTargetLightness(value: Float) Set the target/ideal lightness value for this target. |
Target.Builder |
setLightnessWeight(weight: Float) Set the weight of importance that this target will place on lightness values. |
Target.Builder |
setSaturationWeight(weight: Float) Set the weight of importance that this target will place on saturation values. |
Public constructors
Public methods
setMinimumLightness
fun setMinimumLightness(value: Float): Target.Builder
Set the minimum lightness value for this target.
setTargetSaturation
fun setTargetSaturation(value: Float): Target.Builder
Set the target/ideal saturation value for this target.
setMaximumSaturation
fun setMaximumSaturation(value: Float): Target.Builder
Set the maximum saturation value for this target.
setMaximumLightness
fun setMaximumLightness(value: Float): Target.Builder
Set the maximum lightness value for this target.
setExclusive
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. |
setPopulationWeight
fun setPopulationWeight(weight: 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.
setMinimumSaturation
fun setMinimumSaturation(value: Float): Target.Builder
Set the minimum saturation value for this target.
setTargetLightness
fun setTargetLightness(value: Float): Target.Builder
Set the target/ideal lightness value for this target.
setLightnessWeight
fun setLightnessWeight(weight: 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.
See Also
setSaturationWeight
fun setSaturationWeight(weight: 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.
See Also
Interfaces
Classes