ColorBuilders.LinearGradient.Builder


class ColorBuilders.LinearGradient.Builder


Builder for LinearGradient.

Summary

Public constructors

@RequiresSchemaVersion(major = 1, minor = 500)
@SafeVarargs
Builder(colorStops: Array<ColorBuilders.ColorStop!>)

Creates an instance of Builder.

@RequiresSchemaVersion(major = 1, minor = 500)
@SafeVarargs
Builder(colors: Array<ColorBuilders.ColorProp!>)

Creates an instance of Builder.

Public functions

ColorBuilders.LinearGradient

Builds an instance from accumulated values.

ColorBuilders.LinearGradient.Builder

Sets the ending y position of the linear gradient.

ColorBuilders.LinearGradient.Builder

Sets the ending y position of the linear gradient.

ColorBuilders.LinearGradient.Builder

Sets the starting x position of the linear gradient.

ColorBuilders.LinearGradient.Builder

Sets the starting y position of the linear gradient.

Public constructors

Builder

@RequiresSchemaVersion(major = 1, minor = 500)
@SafeVarargs
Builder(colorStops: Array<ColorBuilders.ColorStop!>)

Creates an instance of Builder.

Parameters
colorStops: Array<ColorBuilders.ColorStop!>

The color stops defining how the colors are distributed from the start to the end coordinates.

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 coordinate and ending with 1.0 at the end coordinate.

Throws
java.lang.IllegalArgumentException

if the number of colors is less than 2 or larger than 10.

Builder

@RequiresSchemaVersion(major = 1, minor = 500)
@SafeVarargs
Builder(colors: Array<ColorBuilders.ColorProp!>)

Creates an instance of Builder.

The colors are evenly distributed in the gradient.

Parameters
colors: Array<ColorBuilders.ColorProp!>

The color sequence to be distributed between the gradient's start and end coordinates.

Throws
java.lang.IllegalArgumentException

if the number of colors is less than 2 or larger than 10.

Public functions

build

Added in 1.3.0-alpha06
fun build(): ColorBuilders.LinearGradient

Builds an instance from accumulated values.

Throws
java.lang.IllegalStateException

if size of colorStops is less than 2 or greater than 10.

setEndX

Added in 1.3.0-alpha06
@RequiresSchemaVersion(major = 1, minor = 500)
fun setEndX(endX: DimensionBuilders.OffsetDimension): ColorBuilders.LinearGradient.Builder

Sets the ending y position of the linear gradient. Defaults to the right side of the element.

setEndY

Added in 1.3.0-alpha06
@RequiresSchemaVersion(major = 1, minor = 500)
fun setEndY(endY: DimensionBuilders.OffsetDimension): ColorBuilders.LinearGradient.Builder

Sets the ending y position of the linear gradient. Defaults to the top side of the element.

setStartX

Added in 1.3.0-alpha06
@RequiresSchemaVersion(major = 1, minor = 500)
fun setStartX(startX: DimensionBuilders.OffsetDimension): ColorBuilders.LinearGradient.Builder

Sets the starting x position of the linear gradient. Defaults to the left side of the element.

setStartY

Added in 1.3.0-alpha06
@RequiresSchemaVersion(major = 1, minor = 500)
fun setStartY(startY: DimensionBuilders.OffsetDimension): ColorBuilders.LinearGradient.Builder

Sets the starting y position of the linear gradient. Defaults to the top side of the element.