Package-level declarations

Types

Link copied to clipboard
enum Color : Enum<Color>

A list of standard ANSI colors.

Link copied to clipboard

Terminal text layers whose colors can be independently modified.

Link copied to clipboard
data class HSV(val h: Int, val s: Float, val v: Float)

Simple data class representing HSV values.

Link copied to clipboard
data class RGB(val r: Int, val g: Int, val b: Int)

Simple data class representing RGB values for some 24-bit color

Functions

Link copied to clipboard
fun RenderScope.black(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false)

Marks the current scope so that any text after this point will be colored black.

fun RenderScope.black(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored black.

Link copied to clipboard
fun RenderScope.blue(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false)

Marks the current scope so that any text after this point will be colored blue.

fun RenderScope.blue(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored blue.

Link copied to clipboard

Marks the current scope so that any text after this point will be bolded.

fun RenderScope.bold(scopedBlock: RenderScope.() -> Unit)

Creates a new scope within which any text will be bolded.

Link copied to clipboard

Clear all actively set text effects.

Link copied to clipboard

Clears a previous call to bold.

Link copied to clipboard
fun RenderScope.clearColor(layer: ColorLayer = ColorLayer.FG)

Clears any color set earlier in this scope on a particular ColorLayer.

fun RenderScope.clearColor(layer: ColorLayer = ColorLayer.FG, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any color set earlier on a particular ColorLayer will be cleared.

Link copied to clipboard

Clears any colors set earlier in this scope.

fun RenderScope.clearColors(scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any colors set earlier will be cleared.

Link copied to clipboard

Clears a previous call to invert.

Link copied to clipboard

Clears a previous call to strikethrough.

Link copied to clipboard

Clears a previous call to underline.

Link copied to clipboard
fun RenderScope.color(color: Color, layer: ColorLayer = ColorLayer.FG)

Marks the current scope so that any text after this point will be colored with the specified Color value.

fun RenderScope.color(index: Int, layer: ColorLayer = ColorLayer.FG)

Marks the current scope so that any text after this point will be colored by the color associated with the ANSI color index.

fun RenderScope.color(color: Color, layer: ColorLayer = ColorLayer.FG, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored with the specified Color value.

fun RenderScope.color(index: Int, layer: ColorLayer = ColorLayer.FG, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored using a color associated with the ANSI color index.

Link copied to clipboard
fun RenderScope.cyan(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false)

Marks the current scope so that any text after this point will be colored cyan.

fun RenderScope.cyan(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored cyan.

Link copied to clipboard
fun RenderScope.green(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false)

Marks the current scope so that any text after this point will be colored green.

fun RenderScope.green(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored green.

Link copied to clipboard
fun RenderScope.hsv(color: HSV, layer: ColorLayer = ColorLayer.FG)
fun RenderScope.hsv(hsv: HSV, layer: ColorLayer = ColorLayer.FG, scopedBlock: RenderScope.() -> Unit)

fun RenderScope.hsv(h: Int, s: Float, v: Float, layer: ColorLayer = ColorLayer.FG)

Marks the current scope so that any text after this point will be colored by the input HSV value.

fun RenderScope.hsv(h: Int, s: Float, v: Float, layer: ColorLayer = ColorLayer.FG, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored by the input HSV value.

Link copied to clipboard

Marks the current scope as inverted, so that any text after this point will be rendered with its background and foreground color layers switched.

fun RenderScope.invert(scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be rendered with its background and foreground color layers switched.

Link copied to clipboard
fun RenderScope.link(uri: Uri, displayText: CharSequence = uri.toString())

Render text backed by a link, so it can be clicked to navigate to some URI.

fun RenderScope.link(uri: CharSequence, displayText: CharSequence = uri)
Link copied to clipboard
fun RenderScope.magenta(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false)

Marks the current scope so that any text after this point will be colored magenta.

fun RenderScope.magenta(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored magenta.

Link copied to clipboard
fun RenderScope.p(block: RenderScope.() -> Unit)

Create a "paragraph" for text.

Link copied to clipboard
fun RenderScope.red(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false)

Marks the current scope so that any text after this point will be colored red.

fun RenderScope.red(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored red.

Link copied to clipboard
fun RenderScope.rgb(color: RGB, layer: ColorLayer = ColorLayer.FG)
fun RenderScope.rgb(rgb: RGB, layer: ColorLayer = ColorLayer.FG, scopedBlock: RenderScope.() -> Unit)

fun RenderScope.rgb(value: Int, layer: ColorLayer = ColorLayer.FG)

Marks the current scope so that any text after this point will be colored by the RGB hex value.

fun RenderScope.rgb(value: Int, layer: ColorLayer = ColorLayer.FG, scopedBlock: RenderScope.() -> Unit)

Marks the current scope so that any text after this point will be colored by the input hex value.

fun RenderScope.rgb(r: Int, g: Int, b: Int, layer: ColorLayer = ColorLayer.FG)

Marks the current scope so that any text after this point will be colored by the input RGB value.

fun RenderScope.rgb(r: Int, g: Int, b: Int, layer: ColorLayer = ColorLayer.FG, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored by the input RGB value.

Link copied to clipboard

Marks the current scope so that any text after this point will be struck-through.

fun RenderScope.strikethrough(scopedBlock: RenderScope.() -> Unit)

Creates a new scope within which any text will be struck-through.

Link copied to clipboard

Append a character to the current section.

Append some text to the current section.

Link copied to clipboard

Append a newline to the current section.

Append a character to the current section, followed by a newline.

Append some text to the current section, followed by a newline.

Link copied to clipboard

Marks the current scope so that any text after this point will be underlined.

fun RenderScope.underline(scopedBlock: RenderScope.() -> Unit)

Creates a new scope within which any text will be underlined.

Link copied to clipboard
fun RenderScope.white(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false)

Marks the current scope so that any text after this point will be colored white.

fun RenderScope.white(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored white.

Link copied to clipboard
fun RenderScope.yellow(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false)

Marks the current scope so that any text after this point will be colored yellow.

fun RenderScope.yellow(layer: ColorLayer = ColorLayer.FG, isBright: Boolean = false, scopedBlock: RenderScope.() -> Unit)

Create a new scope within which any text will be colored yellow.