LinearGradient

open class LinearGradient : Shader
kotlin.Any
   ↳ android.graphics.Shader
   ↳ android.graphics.LinearGradient

Summary

Public constructors
<init>(x0: Float, y0: Float, x1: Float, y1: Float, colors: IntArray, positions: FloatArray?, tile: Shader.TileMode)

Create a shader that draws a linear gradient along a line.

<init>(x0: Float, y0: Float, x1: Float, y1: Float, color0: Int, color1: Int, tile: Shader.TileMode)

Create a shader that draws a linear gradient along a line.

Inherited functions

Public constructors

<init>

LinearGradient(x0: Float, y0: Float, x1: Float, y1: Float, colors: IntArray, positions: FloatArray?, tile: Shader.TileMode)

Create a shader that draws a linear gradient along a line.

Parameters
x0 Float: The x-coordinate for the start of the gradient line
y0 Float: The y-coordinate for the start of the gradient line
x1 Float: The x-coordinate for the end of the gradient line
y1 Float: The y-coordinate for the end of the gradient line
colors Float: The colors to be distributed along the gradient line This value must never be null.
positions Float: May be null. The relative positions [0..1] of each corresponding color in the colors array. If this is null, the the colors are distributed evenly along the gradient line. This value may be null.
tile Float: The Shader tiling mode This value must never be null.

<init>

LinearGradient(x0: Float, y0: Float, x1: Float, y1: Float, color0: Int, color1: Int, tile: Shader.TileMode)

Create a shader that draws a linear gradient along a line.

Parameters
x0 Float: The x-coordinate for the start of the gradient line
y0 Float: The y-coordinate for the start of the gradient line
x1 Float: The x-coordinate for the end of the gradient line
y1 Float: The y-coordinate for the end of the gradient line
color0 Float: The color at the start of the gradient line.
color1 Float: The color at the end of the gradient line.
tile Float: The Shader tiling mode This value must never be null.