UI.Attribute

Styles that can be applied to elements.

You will usually pass an array of these as the first argument to your UI element functions.

Attributes

type Attribute

Base attribute type.

color : Color -> Attribute

Set the text and/or border color of an element.

See blaix/gren-ansi for available color options.

bgColor : Color -> Attribute

Set the background color of an element.

See blaix/gren-ansi for available color options.

fontWeight : FontWeight -> Attribute

Set the font weight of an element.

See blaix/gren-ansi for available font weight options.

italic : Attribute

Set an element's text to italic.

Applying Attributes

You shouldn't need these functions in a normal app.

gren-tui will apply them for you when it renders your view. But maybe you're writing a package or doing something weird? If so, have fun!

apply : Attribute -> String -> String

Apply attributes to a string.

The string will be returned wrapped in ANSI escape sequences for the specified attributes.

applyAll : Array Attribute -> String -> String

Apply attributes to all strings in an array.

The array will be returned with all strings wrapped in ANSI escape sequences for the specified attributes.