PolyColor

abstract class 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

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Link copied to clipboard
open class Animated(hue: Float, saturation: Float, brightness: Float, alpha: Float) : PolyColor.Mutable, PolyColor.Dynamic, PolyColor.Animatable
Link copied to clipboard
class Chroma(hue: Float, saturation: Float, brightness: Float, alpha: Float, var speedNanos: Long) : PolyColor.Mutable, PolyColor.Dynamic
Link copied to clipboard
object Constants
Link copied to clipboard
interface Dynamic

Represents a color which is has some kind of operation that updates it based on time, for example, an animation.

Link copied to clipboard
open class Gradient(val color1: PolyColor, val color2: PolyColor, val type: PolyColor.Gradient.Type = Type.LeftToRight) : PolyColor
Link copied to clipboard
interface Mut
Link copied to clipboard
open class Mutable(hue: Float, saturation: Float, brightness: Float, alpha: Float) : PolyColor, PolyColor.Mut
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")
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")
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")
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")
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
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
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
Link copied to clipboard
open override fun toString(): String