mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Add '-c, --color' option
Allow user to select which ANSI color code to use to colorize the tio text. To successfully set the color the color code must be in the range 0..255. If color code is negative tio will print all available ANSI colors. The default color is changed to bold white to make tio defaults usable for most users, including color blind users.
This commit is contained in:
parent
32e853e46e
commit
274cb63197
7 changed files with 55 additions and 16 deletions
|
|
@ -21,11 +21,12 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "options.h"
|
||||
#include "print.h"
|
||||
|
||||
bool print_tainted = false;
|
||||
bool print_color_mode = false;
|
||||
const char *print_color = ANSI_COLOR_YELLOW;
|
||||
char print_color[20];
|
||||
|
||||
void print_hex(char c)
|
||||
{
|
||||
|
|
@ -50,4 +51,5 @@ void print_normal(char c)
|
|||
void print_set_color_mode(bool mode)
|
||||
{
|
||||
print_color_mode = mode;
|
||||
sprintf(print_color, "\e[1;38;5;%dm", option.color);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue