fill Rect Gradient
fun Canvas.fillRectGradient(x: Int, y: Int, width: Int, height: Int, col1: Color, col2: Color, vertical: Boolean = true)
Draws a filled rectangle with a gradient on the canvas.
Parameters
x
The X coordinate of the rectangle top-left corner
y
The Y coordinate of the rectangle top-left corner
width
The width of the rectangle
height
The height of the rectangle
col1
The first color of the gradient
col2
The second color of the gradient
vertical
Whether the gradient is vertical (true) or horizontal (false)
fun Canvas.fillRectGradient(x: Int, y: Int, width: Int, height: Int, topLeft: Color, bottomLeft: Color, topRight: Color, bottomRight: Color)
Draws a filled rectangle with a four-corner gradient on the canvas.
Parameters
x
The X coordinate of the rectangle top-left corner
y
The Y coordinate of the rectangle top-left corner
width
The width of the rectangle
height
The height of the rectangle
top Left
The color of the top-left corner
bottom Left
The color of the bottom-left corner
top Right
The color of the top-right corner
bottom Right
The color of the bottom-right corner