ColorUtils

Color utility class.

object ColorUtils

Functions

colorIntToRgbaExpression
Link copied to clipboard

Converts Android color int to "rbga(r, g, b, a)" Expression equivalent.

Alpha value will be converted from 0-255 range to 0-1.

fun colorIntToRgbaExpression(@ColorInt() color: Int): Expression
colorToGlRgbaArray
Link copied to clipboard

Converts Android color int to GL rgba float array.

Returned values range from 0-1.

fun colorToGlRgbaArray(@ColorInt() color: Int): FloatArray
colorToRgbaArray
Link copied to clipboard

Converts Android color int to rgba float array.

Returned RGB values range from 0 to 255. Alpha value ranges from 0-1.

fun colorToRgbaArray(@ColorInt() color: Int): FloatArray
colorToRgbaString
Link copied to clipboard

Converts Android color int to "rbga(r, g, b, a)" String equivalent.

Alpha value will be converted from 0-255 range to 0-1.

fun colorToRgbaString(@ColorInt() color: Int): String
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
rgbaExpressionToColorInt
Link copied to clipboard

Convert an rgba Expression to a Color int.

R, G, B color components have to be in the 0-255 range, while alpha has to be in the 0.0-1.0 range. For example: "rgba(255, 128, 0, 0.7)".

fun rgbaExpressionToColorInt(value: Expression): Int?
rgbaExpressionToColorString
Link copied to clipboard

Convert an rgba Expression to a Color String.

R, G, B color components have to be in the 0-255 range, while alpha has to be in the 0.0-1.0 range. For example: "rgba(255, 128, 0, 0.7)".

fun rgbaExpressionToColorString(value: Expression): String?
rgbaToColor
Link copied to clipboard

Convert an rgba string to a Color int.

R, G, B color components have to be in the 0-255 range, while alpha has to be in the 0.0-1.0 range. For example: "rgba(255, 128, 0, 0.7)".

fun rgbaToColor(value: String): Int?
toString
Link copied to clipboard
open override fun toString(): String