ColorBuilders.SweepGradient


@RequiresSchemaVersion(major = 1, minor = 300)
class ColorBuilders.SweepGradient : 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 functions

(Mutable)List<ColorBuilders.ColorStop!>

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

DimensionBuilders.DegreesProp

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

DimensionBuilders.DegreesProp

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

String

Public functions

getColorStops

Added in 1.1.0
fun getColorStops(): (Mutable)List<ColorBuilders.ColorStop!>

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
fun getEndAngle(): DimensionBuilders.DegreesProp

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
fun getStartAngle(): DimensionBuilders.DegreesProp

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

fun toString(): String