HslAdjustment.Builder


public final class HslAdjustment.Builder


A builder for HslAdjustment instances.

Summary

Public constructors

Creates a new instance with the default values.

Public methods

HslAdjustment.Builder
@CanIgnoreReturnValue
adjustHue(float hueAdjustmentDegrees)

Rotates the hue of the frame by hueAdjustmentDegrees.

HslAdjustment.Builder
@CanIgnoreReturnValue
adjustLightness(
    @FloatRange(from = "-100", to = 100) float lightnessAdjustment
)

Adjusts the lightness of the frame by lightnessAdjustment.

HslAdjustment.Builder
@CanIgnoreReturnValue
adjustSaturation(
    @FloatRange(from = "-100", to = 100) float saturationAdjustment
)

Adjusts the saturation of the frame by saturationAdjustment.

HslAdjustment

Creates a new HslAdjustment instance.

Public constructors

Builder

public Builder()

Creates a new instance with the default values.

Public methods

adjustHue

@CanIgnoreReturnValue
public HslAdjustment.Builder adjustHue(float hueAdjustmentDegrees)

Rotates the hue of the frame by hueAdjustmentDegrees.

The Hue of the frame is defined in the interval of [0, 360] degrees. The actual degrees of hue adjustment applied is hueAdjustmentDegrees % 360.

Parameters
float hueAdjustmentDegrees

The hue adjustment in rotation degrees. The default value is 0, which means no change is applied.

adjustLightness

@CanIgnoreReturnValue
public HslAdjustment.Builder adjustLightness(
    @FloatRange(from = "-100", to = 100) float lightnessAdjustment
)

Adjusts the lightness of the frame by lightnessAdjustment.

Lightness is defined in the interval of [0, 100] where a lightness of 0 is a black frame and a lightness of 100 is a white frame.

Parameters
@FloatRange(from = "-100", to = 100) float lightnessAdjustment

The difference by how much the lightness will be adjusted in either direction. Needs to be in the interval of [-100, 100] and the default value is 0, which means no change is applied.

adjustSaturation

@CanIgnoreReturnValue
public HslAdjustment.Builder adjustSaturation(
    @FloatRange(from = "-100", to = 100) float saturationAdjustment
)

Adjusts the saturation of the frame by saturationAdjustment.

Saturation is defined in the interval of [0, 100] where a saturation of 0 will generate a grayscale frame and a saturation of 100 has a maximum separation between the colors.

Parameters
@FloatRange(from = "-100", to = 100) float saturationAdjustment

The difference of how much the saturation will be adjusted in either direction. Needs to be in the interval of [-100, 100] and the default value is 0, which means no change is applied.

build

public HslAdjustment build()

Creates a new HslAdjustment instance.