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.
- Ansi
Flags - A set of flags to determine text style with ANSI color codes.
- Color
- Wrapper struct around a (u8, u8, u8) tuple.
Enums§
- Color
Parse Error - Error type used when parsing a color.
- Colors
- Enum containing known named colors.
Traits§
- Into
Ansi - Trait used to enable style functions to accept value or closure.
- Styled
- Trait used to add a
style“extension method” to any type that implementsDisplayas a convenience to callstyle_text. - Styled
String - 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
Displayusing the style described bystyle.Scan be either anAnsior a closure that returns anAnsi. This might require bringing theIntoAnsitrait into scope. - styled_
print - Shortcut to call
print!with the output ofstyle_text. - styled_
println - Shortcut to call
println!with the output ofstyle_text.