Provide stream API with implicit conversions
Most term styling crates require the format-site to know the capabilities of the intended output stream. This complicates things when the the format-site and outputting are decoupled.
The idea for this is that people choose the ansi styling crate of their choice and a special set of stdout/stderr streams then handle the conversion of ansi styling to what the terminal is capable of.
Conversions
- Graceful degration to lower colors or no colors
- Convert to wincon api
See https://crates.io/crates/fwdansi/
https://crates.io/crates/strip-ansi-cli
How rich handles color conversion
- https://github.comTextualize/rich/blob/master/rich/_palettes.py
- https://github.com/Textualize/rich/blob/0bdbe550c4bdc68058ca285f20bc3d57aa0a0ba7/rich/color.py#L548
MIT
https://crates.io/crates/rgb2ansi256 LGPL https://crates.io/crates/ansi_colours LGPL