Package-level declarations

Types

Link copied to clipboard
typealias Color = PolyColor
Link copied to clipboard
interface Colors

Colors is the color storage for PolyUI. All PolyUI drawables use these colors. or even changed on the fly using the field in the PolyUI instance, bringing theming to PolyUI.

Link copied to clipboard
open class DarkTheme : Colors

The default color set used in PolyUI.

Link copied to clipboard
open class LightTheme : Colors

The default light color set used in PolyUI.

Link copied to clipboard
abstract class PolyColor

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

Properties

Link copied to clipboard
Link copied to clipboard
val Int.blue: Int
Link copied to clipboard
Link copied to clipboard
val Int.red: Int

Functions

Link copied to clipboard
Link copied to clipboard
fun argb(argb: Int): PolyColor
Link copied to clipboard
fun hex(hex: String): PolyColor
Link copied to clipboard
fun hsba(h: Float, s: Float, b: Float, a: Float = 1.0f): PolyColor.Static
Link copied to clipboard
fun HSBtoRGB(hue: Float, saturation: Float, brightness: Float, alpha: Float = 1.0f): Int

Converts the components of a color, as specified by the HSB model, to an equivalent set of values for the default RGB model.

Link copied to clipboard
Link copied to clipboard
fun rgba(r: Int, g: Int, b: Int, a: Float = 1.0f): PolyColor

create a color from the given red, green, and blue integer values, and an alpha value 0f..1f

Link copied to clipboard
fun RGBtoHSB(r: Int, g: Int, b: Int, out: FloatArray? = null): FloatArray

Converts the components of a color, as specified by the default RGB model, to an equivalent set of values for hue, saturation, and brightness that are the three components of the HSB model.

Link copied to clipboard

Takes an ARGB integer color and returns a PolyColor object.

Turn the given hex string into a color.

fun String.toColor(alpha: Float = 1.0f): PolyColor
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

Return a PolyUI compatible color object representative of this Java color object.