Crate ansirs

source ·
Expand description

Ansirs

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

Modules

Contains code for iterating over named colors.

Structs

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

Enums

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

Traits

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

Functions

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.
Shortcut to call print! with the output of style_text.
Shortcut to call println! with the output of style_text.