withColor

DSL helper for applying color to a block of text.

This is the recommended way to add colored text as it automatically manages the annotation stack.

Example:

buildOudsAnnotatedHeadingText {
append("This is ")
withColor(OudsTheme.colorScheme.content.brandSecondary) {
append("brand secondary text")
}
}

Return

The result of the block.

Parameters

color

The color to apply to the text.

block

The lambda that appends the text to be colored.