TerminalColorPalette

class TerminalColorPalette(val defaultForeground: Int = 0xFFFFFFFF.toInt(), val defaultBackground: Int = 0xFF000000.toInt(), val selectionForeground: Int = 0xFFFFFFFF.toInt(), val selectionBackground: Int = 0xFF000000.toInt(), val cursorForeground: Int = 0xFF000000.toInt(), val cursorBackground: Int = 0xFFFFFFFF.toInt(), indexedColors: IntArray = defaultIndexedColors(), val boldAsBright: Boolean = true)

Immutable resolved terminal color palette.

Colors are stored as packed ARGB integers so painting code can resolve cell foreground and background colors without allocating platform color objects per cell.

Parameters

indexedColors

256-entry indexed palette in packed ARGB form.

Constructors

Link copied to clipboard
constructor(defaultForeground: Int = 0xFFFFFFFF.toInt(), defaultBackground: Int = 0xFF000000.toInt(), selectionForeground: Int = 0xFFFFFFFF.toInt(), selectionBackground: Int = 0xFF000000.toInt(), cursorForeground: Int = 0xFF000000.toInt(), cursorBackground: Int = 0xFFFFFFFF.toInt(), indexedColors: IntArray = defaultIndexedColors(), boldAsBright: Boolean = true)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

whether indexed ANSI 0..7 foreground colors should use bright variants 8..15 when bold is active.

Link copied to clipboard

cursor background ARGB color.

Link copied to clipboard

cursor foreground ARGB color.

Link copied to clipboard

default background ARGB color.

Link copied to clipboard

default foreground ARGB color.

Link copied to clipboard

selection background ARGB color.

Link copied to clipboard

selection foreground ARGB color.

Functions

Link copied to clipboard
fun background(attrWord: Long): Int

Resolves the background color for attrWord.

Link copied to clipboard
fun copy(defaultForeground: Int = this.defaultForeground, defaultBackground: Int = this.defaultBackground, selectionForeground: Int = this.selectionForeground, selectionBackground: Int = this.selectionBackground, cursorForeground: Int = this.cursorForeground, cursorBackground: Int = this.cursorBackground, indexedColors: IntArray = indexedColorStorage, boldAsBright: Boolean = this.boldAsBright): TerminalColorPalette

Creates a palette with selected properties replaced.

Link copied to clipboard
fun copyIndexedColorsInto(destination: IntArray, offset: Int = 0)

Copies the indexed palette into destination.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun foreground(attrWord: Long): Int

Resolves the foreground color for attrWord.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun indexedColor(index: Int): Int

Returns an indexed palette color without exposing mutable palette storage.

Link copied to clipboard

Returns a newly allocated copy of the indexed palette.

Link copied to clipboard
open override fun toString(): String