rainbow / com.skydoves.rainbow / Rainbow

Rainbow

class Rainbow

An easy way to apply gradations and tinting for Android.

Constructors

<init>

An easy way to apply gradations and tinting for Android.

Rainbow(view: View)

Properties

view

val view: View

Functions

addColor

adds a color int to the rainbow list.

fun addColor(color: Int): Rainbow

addColorArray

adds a color array to the rainbow list.

fun addColorArray(colors: IntArray): Rainbow

addColorList

adds a color list to the rainbow list.

fun addColorList(colors: List<Int>): Rainbow

addContextColor

adds a resource color to the rainbow list.

fun addContextColor(color: Int): Rainbow

background

applies gradation effect composed with palette colors to the background. For Java.

fun background(): Unit

applies gradation effect composed with palette colors to the background.

fun background(orientation: RainbowOrientation = RainbowOrientation.LEFT_RIGHT, radius: Int = 0): Unit

foreground

applies gradation effect composed with palette colors to the foreground. For Java.

fun foreground(): Unit

applies gradation effect composed with palette colors to the foreground.

fun foreground(orientation: RainbowOrientation = RainbowOrientation.LEFT_RIGHT, radius: Int = 0): Unit

getDrawable

gets the gradation drawable which composed with palette colors. For Java.

fun getDrawable(): GradientDrawable

gets the gradation drawable which composed with palette colors.

fun getDrawable(orientation: RainbowOrientation = RainbowOrientation.LEFT_RIGHT, radius: Int = 0): GradientDrawable

palette

constructs a palette for collecting colors.

fun palette(block: Rainbow.() -> Unit): Rainbow

tint

applies a tint to the view which can be tinted.

fun tint(): Unit

unaryPlus

operator fun ContextColor.unaryPlus(): Boolean
operator fun List<Int>.unaryPlus(): Boolean
operator fun IntArray.unaryPlus(): Boolean

withAlpha

sets an alpha value for presenting gradation.

fun withAlpha(alpha: Int): Rainbow

withElevation

sets an elevation to the view.

fun withElevation(elevation: Float): Rainbow

Extension Functions

color

creates an instance of ContextColor using a color value.

fun Rainbow.color(color: Int): ContextColor

colorArray

creates a list of ContextColor using a color array.

fun Rainbow.colorArray(colors: IntArray): List<ContextColor>

colorList

creates a list of ContextColor using a color list.

fun Rainbow.colorList(colors: List<Int>): List<ContextColor>

contextColor

creates an instance of ContextColor using a resource color value.

fun Rainbow.contextColor(color: Int): ContextColor