#Colored crate

6 messages · Page 1 of 1 (latest)

warm bough
#

Unfortunately things are complex.

Safe rust, easy to use, minimal dependencies, complete test suite
Respect the CLICOLOR/CLICOLOR_FORCE behavior (see the specs)
Respect the NO_COLOR behavior (see the specs)
Do note that CLICOLOR_FORCE overrules NO_COLOR, which overrules CLICOLOR
Works on Linux, MacOS, and Windows (Powershell)
It has to support 3 different OSes and 4 different flags. I'd think that that combined with supporting foreground, background, and style merits it's own struct. Plus it kind of does, since there are also the methods to and froming String, and impl<'a> Colorize for &'a str. In general, the more general a thing is, the more complex it has to be.

dapper sapphire
#

Also writing to the start of a string can be expensive

#

Having a display impl is more efficient

#

It also means the user never really has to care about the implementation detail

eternal egret
#

👍

stable cove
#

Also checkout owo-colors