Home¶
Fish library that streamlines ANSI formatting used in the terminal
set_color drawbacks¶
Though Fish has a built-in command to perform these operations: set_color, it merely makes the existing sequences readable instead of trying to become the formatting tool by implementing a syntax.
Unintuitive¶
Text Color focused¶
Formatting options other than the text color, as suggested by the name, isn't the main operation of the program. Other formatting options — background, lines — are accessed via flags.
Vague¶
set_color works disparately than the other well-designed Fish commands.
Color for every variant¶
set_color has a bright variant as a color option for every color it offers.
Because of this:
- It is harder to select a color from completions, because there are double the options than their could be
- Meaning of brred is unclear to anyone who doesn't know what br stands for.
Retains Functionality
This library counters this such that you simply pick the color, and modify the variant with flags—if needed.
All at once¶
Unlike the other Fish commands that nest themselves for further changes, set_color makes all the changes together by printing ANSI sequences that come before the string, While still requiring two commands to be used.
Not self-contained¶
Instead of accepting the whole string that needs to be formatted, it mimics the standard ANSI sequences by surrounding the string and seperately genarating sequences with two different commands.
Repetitive¶
Each time you need to format a string, you first need to make the formatting with set_color, followed by an echo with the string, with a set_color --reset.
Inexpandible¶
Flags¶
Since Set Color is text-color focused, any new functionality needs to be added as new flags.
So for underlines, you first need to enable them with one flag (underline), and then change it's color with another (underline-color=).
Limited¶
All ANSI sequences aren't covered. This library additionality includes formatting options for hypertext
set_color horror
This is a help text file from an old, abandoned, learning project of mine View File
All of these issues are solved in this library.
Head over to Usage to learn how to use the library (with examples from set_color alongside).
See Tips to learn clever ways of using the library.