Skip to content

Commit

Permalink
Add an option "-p powershell" for PowerShell color palette
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Aug 23, 2020
1 parent 4ff31af commit 024dc48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions color.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ uint32_t color_list[256] = {
Taken from http://en.wikipedia.org/wiki/ANSI_escape_code
- palette16_standard_vga Standard VGA colors
- palette16_winxp_cmd Windows XP CMD
- palette16_power_shell PowerShell
- palette16_terminal_app Terminal.app
- palette16_putty PuTTY
- palette16_mirc mIRC
Expand Down Expand Up @@ -106,6 +107,11 @@ static const uint32_t palette16_winxp_cmd[16] = {
0x808080, 0xFF0000, 0x00FF00, 0xFFFF00, 0x0000FF, 0xFF00FF, 0x00FFFF, 0xFFFFFF,
};

static const uint32_t palette16_power_shell[16] = {
0x000000, 0x800000, 0x008000, 0xEEEDF0, 0x000080, 0x012456, 0x008080, 0xC0C0C0,
0x808080, 0xFF0000, 0x00FF00, 0xFFFF00, 0x0000FF, 0xFF00FF, 0x00FFFF, 0xFFFFFF,
};

static const uint32_t palette16_win_console[16] = {
0x0c0c0c, 0xc50f1f, 0x13a10e, 0xc19c00, 0x0037da, 0x881798, 0x3a96dd, 0xcccccc,
0x767676, 0xe74856, 0x16c60c, 0xf9f1a5, 0x3b78ff, 0xb4009e, 0x61d6d6, 0xf2f2f2,
Expand Down Expand Up @@ -154,6 +160,8 @@ const uint32_t* color_parse_palette16(const char* name) {
return palette16_winxp_cmd;
else if (strcmp(name, "win") == 0)
return palette16_win_console;
else if (strcmp(name, "powershell") == 0)
return palette16_power_shell;
else if (strcmp(name, "app") == 0)
return palette16_terminal_app;
else if (strcmp(name, "putty") == 0)
Expand Down
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ static void show_help()
"-p, --palette16=NAME specify a color palette name for the\n"
" first 16 colors. NAME is one of the\n"
" following names: 'vga', 'cmd', 'win',\n"
" 'app', 'putty', 'mirc', 'xterm',\n"
" 'ubuntu', and 'seq2gif'. (default:\n"
" 'vga').\n"
" 'powershell', 'app', 'putty', 'mirc',\n"
" 'xterm', 'ubuntu', and 'seq2gif'.\n"
" (default: 'vga').\n"
);
}

Expand Down

0 comments on commit 024dc48

Please sign in to comment.