-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Colors can help a lot in decreasing the time it takes to understand a listing or at least infer where to look at more closely. To that end, this change enables the coloring of gains/losses when printing positions. There are various crates that allow us to colorize text in a terminal using ANSI escape sequences, all with different trade-offs. We currently rely on the yansi crate for doing this job. The downside is that it is a new dependency. Ideally we would want to use ansi_term instead (which is already pulled in by other dependencies), but it turns out that the color enabled strings it produces do not handle advanced formatting options as we use them properly. See ogham/rust-ansi-term#59 for details. We also have used the colored crate successfully, but it does not support RGB colors (only predefined ones) and the default green is commonly too bright. Also, it comes with more dependencies than seemingly necessary.
- Loading branch information
Showing
2 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters