ColorBuilders.SweepGradient


@RequiresSchemaVersion(major = 1, minor = 300)
public final class ColorBuilders.SweepGradient implements ColorBuilders.Brush


A sweep gradient with the given colors dispersed around its center with offsets defined in each color stop. The sweep begins at the parent's base angle plus the given angular shift and continues clockwise until it reaches the starting position again.

The gradient center corresponds to center of the parent element.

Summary

Nested types

Builder for SweepGradient.

Public methods

@NonNull List<ColorBuilders.ColorStop>

Gets the color stops defining how the colors are distributed around the gradient center.

@NonNull DimensionBuilders.DegreesProp

Gets the end angle of the gradient, relative to the element's base angle.

@NonNull DimensionBuilders.DegreesProp

Gets the start angle of the gradient relative to the element's base angle.

@NonNull String

Public methods

getColorStops

Added in 1.1.0
public @NonNull List<ColorBuilders.ColorStopgetColorStops()

Gets the color stops defining how the colors are distributed around the gradient center. The color sequence starts at the start angle and spans 360 degrees clockwise, finishing at the same angle.

A color stop is a pair of a color and its offset in the gradient. The offset is the relative position of the color, beginning with 0 from the start angle and ending with 1.0 at the end angle, spanning clockwise.

There must be at least 2 colors and at most 10 colors.

If offset values are not set, the colors are evenly distributed in the gradient.

getEndAngle

Added in 1.1.0
public @NonNull DimensionBuilders.DegreesProp getEndAngle()

Gets the end angle of the gradient, relative to the element's base angle. If not set, defaults to 360 degrees.

For androidx.wear.protolayout.LayoutElementBuilders.ArcLine, the base angle is the angle where the line starts. The value represents a relative position in the line's length span. Values greater than 360 degrees correspond to upper layers of the arc line as it wraps over itself.

getStartAngle

Added in 1.1.0
public @NonNull DimensionBuilders.DegreesProp getStartAngle()

Gets the start angle of the gradient relative to the element's base angle. If not set, defaults to zero.

For androidx.wear.protolayout.LayoutElementBuilders.ArcLine, the base angle is the angle where the line starts. The value represents a relative position in the line's length span. Values greater than 360 degrees correspond to upper layers of the arc line as it wraps over itself.

toString

public @NonNull String toString()