TargetNode.Target


public final class TargetNode.Target


List of scalar tip properties that can be modified by a androidx.ink.brush.BrushBehavior.

Summary

Public fields

static final @NonNull TargetNode.Target

Scales the chroma of the base brush color.

static final @NonNull TargetNode.Target

Adds the target modifier to androidx.ink.brush.BrushTip.cornerRounding.

static final @NonNull TargetNode.Target

Scales the brush-tip height, starting from the value calculated using androidx.ink.brush.BrushTip.scaleY.

static final @NonNull TargetNode.Target

Shifts the hue of the base brush color, while maintaining the same level of perceived lightness.

static final @NonNull TargetNode.Target

Shifts the perceived lightness of the base brush color.

static final @NonNull TargetNode.Target

Scales the opacity of the base brush color.

static final @NonNull TargetNode.Target

Adds the target modifier to the initial brush paint animation progress value of the current particle (which is relevant only for strokes with an animated BrushPaint).

static final @NonNull TargetNode.Target

Adds the target modifier to androidx.ink.brush.BrushTip.pinch.

static final @NonNull TargetNode.Target

Moves the brush tip by the target modifier times the brush size in the direction of the modeled stroke input's velocity (the opposite direction if the value is negative).

static final @NonNull TargetNode.Target

Moves the brush tip by the target modifier times the brush size perpendicular to the modeled stroke input's velocity, rotated 90 degrees in the direction from the positive x-axis to the positive y-axis.

static final @NonNull TargetNode.Target

Adds the target modifier times the brush size to the brush tip x position.

static final @NonNull TargetNode.Target

Adds the target modifier times the brush size to the brush tip y position .

static final @NonNull TargetNode.Target

Adds the target modifier to androidx.ink.brush.BrushTip.rotationDegrees.

static final @NonNull TargetNode.Target

Convenience enumerator to target both WIDTH_MULTIPLIER and HEIGHT_MULTIPLIER.

static final @NonNull TargetNode.Target

Adds the target modifier to androidx.ink.brush.BrushTip.slantDegrees.

static final @NonNull TargetNode.Target

Scales the brush-tip width, starting from the value calculated using androidx.ink.brush.BrushTip.scaleX.

Public methods

final @NonNull Version

Returns the minimum required Version for this Target.

@NonNull String

Public fields

CHROMA_MULTIPLIER

public static final @NonNull TargetNode.Target CHROMA_MULTIPLIER

Scales the chroma of the base brush color. A value greater than 1.0 makes the color more saturated, a value less than 1.0 makes the color less saturated, and a value of 0.0 makes the color grayscale. If multiple behaviors have one of these targets, they stack multiplicatively. The final chroma multiplier is clamped to 0, 2.

CORNER_ROUNDING_OFFSET

public static final @NonNull TargetNode.Target CORNER_ROUNDING_OFFSET

Adds the target modifier to androidx.ink.brush.BrushTip.cornerRounding. The final brush corner rounding value is clamped to 0, 1. If multiple behaviors have this target, they stack additively.

HEIGHT_MULTIPLIER

public static final @NonNull TargetNode.Target HEIGHT_MULTIPLIER

Scales the brush-tip height, starting from the value calculated using androidx.ink.brush.BrushTip.scaleY. If multiple behaviors have this target, they stack multiplicatively.

HUE_OFFSET_IN_RADIANS

public static final @NonNull TargetNode.Target HUE_OFFSET_IN_RADIANS

Shifts the hue of the base brush color, while maintaining the same level of perceived lightness. A positive offset shifts around the hue wheel from red towards orange, while a negative offset shifts the other way, from red towards violet. The final hue offset is not clamped, but is effectively normalized (mod 2π). If multiple behaviors have this target, they stack additively.

LIGHTNESS_OFFSET

public static final @NonNull TargetNode.Target LIGHTNESS_OFFSET

Shifts the perceived lightness of the base brush color. An offset of ±1.0 corresponds to changing the lightness by up to ±100%. If multiple behaviors have this target, they stack additively. The final lightness offset is clamped to -1, 1.

OPACITY_MULTIPLIER

public static final @NonNull TargetNode.Target OPACITY_MULTIPLIER

Scales the opacity of the base brush color. If multiple behaviors have one of these targets, they stack multiplicatively. The final opacity multiplier is clamped to 0, 2.

PAINT_ANIMATION_PROGRESS_OFFSET

public static final @NonNull TargetNode.Target PAINT_ANIMATION_PROGRESS_OFFSET

Adds the target modifier to the initial brush paint animation progress value of the current particle (which is relevant only for strokes with an animated BrushPaint). The final progress offset is not clamped, but is effectively normalized (mod 2, to account for potential use of AnimationRepeatMode.REVERSE). If multiple behaviors have this target, they stack additively.

PINCH_OFFSET

public static final @NonNull TargetNode.Target PINCH_OFFSET

Adds the target modifier to androidx.ink.brush.BrushTip.pinch. The final brush pinch value is clamped to 0, 1. If multiple behaviors have this target, they stack additively.

POSITION_OFFSET_FORWARD_IN_MULTIPLES_OF_BRUSH_SIZE

public static final @NonNull TargetNode.Target POSITION_OFFSET_FORWARD_IN_MULTIPLES_OF_BRUSH_SIZE

Moves the brush tip by the target modifier times the brush size in the direction of the modeled stroke input's velocity (the opposite direction if the value is negative). For example, if a stroke is moving from left to right, a positive modifier will shift the brush tip to the right, and a negative modifier will shift the brush tip to the left.

POSITION_OFFSET_LATERAL_IN_MULTIPLES_OF_BRUSH_SIZE

public static final @NonNull TargetNode.Target POSITION_OFFSET_LATERAL_IN_MULTIPLES_OF_BRUSH_SIZE

Moves the brush tip by the target modifier times the brush size perpendicular to the modeled stroke input's velocity, rotated 90 degrees in the direction from the positive x-axis to the positive y-axis. For example, if positive-Y is up, and a stroke is moving from left to right, a positive modifier will shift the brush tip up, and a negative modifier will shift the brush tip down.

POSITION_OFFSET_X_IN_MULTIPLES_OF_BRUSH_SIZE

public static final @NonNull TargetNode.Target POSITION_OFFSET_X_IN_MULTIPLES_OF_BRUSH_SIZE

Adds the target modifier times the brush size to the brush tip x position.

POSITION_OFFSET_Y_IN_MULTIPLES_OF_BRUSH_SIZE

public static final @NonNull TargetNode.Target POSITION_OFFSET_Y_IN_MULTIPLES_OF_BRUSH_SIZE

Adds the target modifier times the brush size to the brush tip y position .

ROTATION_OFFSET_IN_RADIANS

public static final @NonNull TargetNode.Target ROTATION_OFFSET_IN_RADIANS

Adds the target modifier to androidx.ink.brush.BrushTip.rotationDegrees. The final brush rotation angle is effectively normalized (mod 2π). If multiple behaviors have this target, they stack additively.

SIZE_MULTIPLIER

public static final @NonNull TargetNode.Target SIZE_MULTIPLIER

Convenience enumerator to target both WIDTH_MULTIPLIER and HEIGHT_MULTIPLIER.

SLANT_OFFSET_IN_RADIANS

public static final @NonNull TargetNode.Target SLANT_OFFSET_IN_RADIANS

Adds the target modifier to androidx.ink.brush.BrushTip.slantDegrees. The final brush slant value is clamped to -π/2, π/2. If multiple behaviors have this target, they stack additively.

WIDTH_MULTIPLIER

public static final @NonNull TargetNode.Target WIDTH_MULTIPLIER

Scales the brush-tip width, starting from the value calculated using androidx.ink.brush.BrushTip.scaleX. If multiple behaviors have this target, they stack multiplicatively.

Public methods

calculateMinimumRequiredVersion

Added in 1.1.0-alpha09
public final @NonNull Version calculateMinimumRequiredVersion()

Returns the minimum required Version for this Target.

By default, decoding a androidx.ink.brush.BrushFamily containing a Target with a minimum required version higher than Version.MAX_SUPPORTED will fail.

toString

public @NonNull String toString()