Attrs

interface Attrs

Represents one or more [fansi.Attr]s, that can be passed around as a set or combined with other sets of [fansi.Attr]s.

Note that a single [Attr] is a subclass of [Attrs]. If you want to know if this contains multiple [Attr]s, you should check for [Attrs.Multiple].

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
class Multiple(val resetMask: Long, val applyMask: Long, val attrs: Attr) : Attrs

Properties

Link copied to clipboard
abstract val applyMask: Long

Which bits of the [Str.State] integer these [Attrs] will set to 1 when it is applied

Link copied to clipboard
abstract val resetMask: Long

Which bits of the [Str.State] integer these [Attrs] will override when it is applied

Functions

Link copied to clipboard
open operator fun invoke(s: Str): Str

Apply these [Attrs] to the given [fansi.Str], making it take effect across the entire length of that string.

open operator fun invoke(s: String): Str
Link copied to clipboard
abstract operator fun plus(other: Attrs): Attrs

Combine this [fansi.Attrs] with other [fansi.Attrs]s, returning one which when applied is equivalent to applying this one and then the other one in series.

Link copied to clipboard
open fun transform(state: State): Long

Apply the current [Attrs] to the [Str.State] integer, modifying it to represent the state after all changes have taken effect