Colors

interface Colors

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.

Since

0.17.0

Inheritors

Types

Link copied to clipboard
class Brand(val fg: Colors.Palette, val accent: Colors.Palette)
Link copied to clipboard
class Component(val bg: Colors.Palette, val bgDeselected: Color)
Link copied to clipboard
class OnBrand(val fg: Colors.Palette, val accent: Colors.Palette)
Link copied to clipboard
class Page(val bg: Colors.Palette, val bgOverlay: Color, val fg: Colors.Palette, val fgOverlay: Color, val border20: Color, val border10: Color, val border5: Color)
Link copied to clipboard
open class Palette(val normal: Color, val hovered: Color, val pressed: Color, val disabled: Color)

A color palette represents a set of four colors in PolyUI representing the four key states that a component can have.

Link copied to clipboard
class State(val danger: Colors.Palette, val warning: Colors.Palette, val success: Colors.Palette)
Link copied to clipboard
class Text(val primary: Colors.Palette, val secondary: Colors.Palette)

Properties

Link copied to clipboard
abstract val brand: Colors.Brand
Link copied to clipboard
Link copied to clipboard
abstract val name: String
Link copied to clipboard
abstract val onBrand: Colors.OnBrand
Link copied to clipboard
abstract val page: Colors.Page
Link copied to clipboard
abstract val state: Colors.State
Link copied to clipboard
abstract val text: Colors.Text

Functions

Link copied to clipboard
open fun getNewColor(currentColor: Color, current: Colors): Color?

Calculate and return the new Color for the given currentColor based on the current and new Colors. This is useful for theming, where you want to change the color of a component based on the current theme. If the currentColor is not found in the current Colors, it will return null.

Link copied to clipboard
open fun getNewPalette(currentPalette: Colors.Palette?, current: Colors): Colors.Palette?

Calculate and return the new Palette for the given currentPalette based on the current and new Colors. This is useful for theming, where you want to change the palette of a component based on the current theme. If the currentPalette is not found in the current Colors, it will return null.