makeSweepGradient

fun makeSweepGradient(center: Point, gradient: Gradient, localMatrix: Matrix33? = null): Shader

Returns a shader that generates a sweep gradient given a center. The shader accepts negative angles and angles larger than 360, draws between 0 and 360 degrees, similar to the CSS conic-gradient semantics. 0 degrees means horizontal positive x axis. The start angle must be less than the end angle, otherwise a null pointer is returned. If color stops do not contain 0 and 1 but are within this range, the respective outer color stop is repeated for 0 and 1. Color stops less than 0 are clamped to 0, and greater than 1 are clamped to 1.

Parameters

center

The center of the sweep

gradient

Description of the colors and interpolation method

localMatrix

Optional local matrix, may be null


fun makeSweepGradient(x: Float, y: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader
fun makeSweepGradient(x: Float, y: Float, startAngle: Float, endAngle: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader


fun makeSweepGradient(center: Point, startAngle: Float, endAngle: Float, gradient: Gradient, localMatrix: Matrix33? = null): Shader

Returns a shader that generates a sweep gradient given a center. The shader accepts negative angles and angles larger than 360, draws between 0 and 360 degrees, similar to the CSS conic-gradient semantics. 0 degrees means horizontal positive x axis. The start angle must be less than the end angle, otherwise a null pointer is returned. If color stops do not contain 0 and 1 but are within this range, the respective outer color stop is repeated for 0 and 1. Color stops less than 0 are clamped to 0, and greater than 1 are clamped to 1.

Parameters

center

The center of the sweep

startAngle

Start of the angular range, corresponding to pos == 0.

endAngle

End of the angular range, corresponding to pos == 1.

gradient

Description of the colors and interpolation method

localMatrix

Optional local matrix, may be null