TerminalRenderAttrs

Stable public render attribute word decoder and packer.

The public ABI is intentionally separate from core's internal attribute storage. The bit layout is:

  • bits 0..1: foreground color kind.

  • bits 2..25: foreground color value.

  • bits 26..27: background color kind.

  • bits 28..51: background color value.

  • bit 52: bold.

  • bit 53: faint.

  • bit 54: italic.

  • bits 55..57: underline style.

  • bit 58: blink.

  • bit 59: inverse.

  • bit 60: invisible.

  • bit 61: strikethrough.

  • bits 62..63: reserved and currently zero.

RGB values are encoded as 0xRRGGBB, indexed values as 0..255, and default color values as zero.

Properties

Link copied to clipboard
const val DEFAULT: Long = 0

Default terminal render attributes.

Functions

Link copied to clipboard
fun backgroundKind(word: Long): Int

Returns the background color kind.

Link copied to clipboard

Returns the background color value.

Link copied to clipboard
fun foregroundKind(word: Long): Int

Returns the foreground color kind.

Link copied to clipboard

Returns the foreground color value.

Link copied to clipboard
fun isBlink(word: Long): Boolean

Returns whether blink style is enabled.

Link copied to clipboard
fun isBold(word: Long): Boolean

Returns whether bold intensity is enabled.

Link copied to clipboard
fun isFaint(word: Long): Boolean

Returns whether faint intensity is enabled.

Link copied to clipboard
fun isInverse(word: Long): Boolean

Returns whether inverse video is enabled.

Link copied to clipboard

Returns whether invisible text style is enabled.

Link copied to clipboard
fun isItalic(word: Long): Boolean

Returns whether italic style is enabled.

Link copied to clipboard

Returns whether strikethrough decoration is enabled.

Link copied to clipboard
fun pack(foregroundKind: Int = TerminalRenderColorKind.DEFAULT, foregroundValue: Int = 0, backgroundKind: Int = TerminalRenderColorKind.DEFAULT, backgroundValue: Int = 0, bold: Boolean = false, faint: Boolean = false, italic: Boolean = false, underlineStyle: Int = TerminalRenderUnderline.NONE, blink: Boolean = false, inverse: Boolean = false, invisible: Boolean = false, strikethrough: Boolean = false): Long

Packs a public render attribute word.

Link copied to clipboard
fun underlineStyle(word: Long): Int

Returns the underline style.