KetraTerm
API · DevelopmentAll versions

TerminalColorPalette

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, isDark: Boolean = true)
constructor()

Creates the built-in dark palette with host-controlled selection presentation.

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

Rendering behavior flags from TerminalColorBehavior, independent of fallback ARGB values.

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

host-declared dark/light theme preference, independent of individual color values. Defaults to the built-in dark fallback; hosts with light or custom themes must supply their preference explicitly.

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, isDark: Boolean = this.isDark): 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
fun copyWithColorBehavior(colorBehavior: Int, 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, isDark: Boolean = this.isDark): TerminalColorPalette

Creates a palette replacing colorBehavior and selected colors together.

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