ColorBuilder

Interface for builders that support colored text annotations.

Implementations can add colors either by specifying ranges with addColor, or by using the push/pop pattern with pushColor and pop. For most use cases, prefer using the withColor DSL helper.

Inheritors

Functions

Link copied to clipboard
abstract fun addColor(color: Color, start: Int, end: Int)

Adds a color to a specific range of text.

Link copied to clipboard
abstract fun pop()

Ends the style or annotation that was added via a push operation before.

abstract fun pop(index: Int)

Ends the styles or annotation up to and including the StrongBuilder.pushStrong or LinkBuilder.pushLink that returned the given index.

Link copied to clipboard
abstract fun pushColor(color: Color): Int

Applies a color to any appended text until a corresponding pop is called.

Link copied to clipboard

DSL helper for applying color to a block of text.