PolyColor

interface PolyColor

Color

(revised 1.3) The color used by PolyUI. It stores the color in the HSBA format, and can be converted to ARGB.

See also

Inheritors

Types

Link copied to clipboard
open class Animatable(hue: Float, saturation: Float, brightness: Float, alpha: Float) : PolyColor.Mutable
Link copied to clipboard
class Chroma(hue: Float, saturation: Float, brightness: Float, alpha: Float, var speedNanos: Long) : PolyColor.Mutable
Link copied to clipboard
object Constants
Link copied to clipboard
open class Gradient(color1: PolyColor, val color2: PolyColor, val type: PolyColor.Gradient.Type) : PolyColor
Link copied to clipboard
open class Mutable(hue: Float, saturation: Float, brightness: Float, alpha: Float) : PolyColor
Link copied to clipboard
open class Static(hue: Float, saturation: Float, brightness: Float, alpha: Float) : PolyColor

Properties

Link copied to clipboard
@get:JvmName(name = "alpha")
open val a: Int

alpha value of this color, from 0 to 255

Link copied to clipboard
abstract val alpha: Float

The alpha of this color. Clamped between 0f..1f.

Link copied to clipboard
abstract val argb: Int

return an integer representation of this color. Utilizes bit-shifts to store the color as one 32-bit integer, like so:

Link copied to clipboard
@get:JvmName(name = "blue")
open val b: Int

blue value of this color, from 0 to 255

Link copied to clipboard
abstract val brightness: Float

The brightness of this color. Clamped between 0f..1f.

Link copied to clipboard
@get:JvmName(name = "green")
open val g: Int

green value of this color, from 0 to 255

Link copied to clipboard
abstract val hue: Float

The hue of this color. Can be any value, but is mod 360, so values are always between 0 and 360.

Link copied to clipboard
@get:JvmName(name = "red")
open val r: Int

red value of this color, from 0 to 255

Link copied to clipboard
abstract val saturation: Float

The saturation of this color. Clamped between 0f..1f.

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun PolyColor.toHex(alpha: Boolean = true, hash: Boolean = true): String
Link copied to clipboard

Return a static java Color object of this color at the instant this method is called.

Link copied to clipboard