setGradient
fun GradientDrawable.setGradient(angle: Int, @ColorInt startColor: Int, @ColorInt endColor: Int): GradientDrawable
Set gradient color and gradient angle.
Since
0.5.3
Parameters
angle
Must be an integer multiple of 45.
startColor
Start gradient color.
endColor
End gradient color.
fun GradientDrawable.setGradient(orientation: GradientDrawable.Orientation, @ColorInt startColor: Int, @ColorInt endColor: Int)
Set gradient color and gradient orientation.
Since
0.5.3
Parameters
orientation
Gradient Orientation.
startColor
Start gradient color.
endColor
End gradient color.
fun GradientDrawable.setGradient(angle: Int, @ColorInt startColor: Int, @ColorInt centerColor: Int, @ColorInt endColor: Int)
Set gradient color and gradient angle.
Since
0.5.3
Parameters
angle
Must be an integer multiple of 45.
startColor
Start gradient color.
centerColor
Center gradient color.
endColor
End gradient color.
fun GradientDrawable.setGradient(orientation: GradientDrawable.Orientation, @ColorInt startColor: Int, @ColorInt centerColor: Int, @ColorInt endColor: Int)
Set gradient color and gradient orientation.
Since
0.5.3
Parameters
orientation
Gradient Orientation.
startColor
Start gradient color.
centerColor
Center gradient color.
endColor
End gradient color.