Crate ansirs

Source
Expand description

§Ansirs

Simple library for working with ANSI escape codes to add pretty colors to your shitty console text.

Modules§

iter
Contains code for iterating over named colors.

Structs§

Ansi
Type for storing the configuration of an ANSI color code.
AnsiFlags
A set of flags to determine text style with ANSI color codes.
Color
Wrapper struct around a (u8, u8, u8) tuple.

Enums§

ColorParseError
Error type used when parsing a color.
Colors
Enum containing known named colors.

Traits§

IntoAnsi
Trait used to enable style functions to accept value or closure.
Styled
Trait used to add a style “extension method” to any type that implements Display as a convenience to call style_text.
StyledString
Trait that is currently only used to try and normalize the interface between my variations of styled strings.
ToColor
Trait used to facilitate converting various types to a color.

Functions§

style_text
Styles the given Display using the style described by style. S can be either an Ansi or a closure that returns an Ansi. This might require bringing the IntoAnsi trait into scope.
styled_print
Shortcut to call print! with the output of style_text.
styled_println
Shortcut to call println! with the output of style_text.