Documentation

class UIColor

A class that represents a single color value.

class UIColor;

Notes

Description

Instances can be used with style properties and UI element color properties. Named colors are available through UI.colors and can be customized using setColors() or the global theme (e.g. WebTheme).

Examples

// Create colors directly
new UIColor("#000")
new UIColor("rgba(0,0,0,0.5)")
UIColor.oklch(0.5, 0.15, 240)

// Use preset colors
UI.colors.black
UI.colors.green.alpha(0.5)
UI.colors.accent.text()

// Create gradients
UIColor.linearGradient(180, UI.colors.blue, UI.colors.green)
UIColor.radialGradient(UI.colors.white, UI.colors.black)

// Create mapped background values
UIColor.mappedValue("background", bg =>
    UIColor.isBrightColor(bg as UIColor)
        ? UI.colors.white
        : UIColor.linearGradient(180, darkGray, black)
)

Constructor

Type members

Static members

Instance members