|
|
|
@ -67,7 +67,7 @@ static NCURSES_COLOR_T change_color_definition(NCURSES_COLOR_T color_number, |
|
|
|
|
|
|
|
|
|
|
|
void init_terminal_ncurses(char *const fg_color_string, char *const bg_color_string, |
|
|
|
void init_terminal_ncurses(char *const fg_color_string, char *const bg_color_string, |
|
|
|
int predef_fg_color, int predef_bg_color, int gradient, |
|
|
|
int predef_fg_color, int predef_bg_color, int gradient, |
|
|
|
int gradient_count, char **gradient_colors, int *width, int *lines) { |
|
|
|
int gradient_count, char **gradient_colors, int gradient_discrete, int *width, int *lines) { |
|
|
|
initscr(); |
|
|
|
initscr(); |
|
|
|
curs_set(0); |
|
|
|
curs_set(0); |
|
|
|
timeout(0); |
|
|
|
timeout(0); |
|
|
|
@ -127,8 +127,10 @@ void init_terminal_ncurses(char *const fg_color_string, char *const bg_color_str |
|
|
|
for (int j = 0; j < individual_size; j++) { |
|
|
|
for (int j = 0; j < individual_size; j++) { |
|
|
|
|
|
|
|
|
|
|
|
for (int k = 0; k < 3; k++) { |
|
|
|
for (int k = 0; k < 3; k++) { |
|
|
|
rgb[col + 1][k] = rgb[col][k] + (rgb[col + 2][k] - rgb[col][k]) * |
|
|
|
if (gradient_discrete) |
|
|
|
(j / (individual_size * 0.85)); |
|
|
|
rgb[col+1][k] = rgb[col][k]; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
rgb[col+1][k] = rgb[col][k] + (rgb[col+2][k] - rgb[col][k]) * (j / (individual_size * 0.85)); |
|
|
|
if (rgb[col + 1][k] > 255) |
|
|
|
if (rgb[col + 1][k] > 255) |
|
|
|
rgb[col][k] = 0; |
|
|
|
rgb[col][k] = 0; |
|
|
|
if (j > individual_size * 0.85) |
|
|
|
if (j > individual_size * 0.85) |
|
|
|
@ -191,8 +193,8 @@ int draw_terminal_ncurses(int is_tty, int terminal_height, int terminal_width, i |
|
|
|
int bar_width, int bar_spacing, int rest, const int f[200], |
|
|
|
int bar_width, int bar_spacing, int rest, const int f[200], |
|
|
|
int flastd[200], int gradient) { |
|
|
|
int flastd[200], int gradient) { |
|
|
|
const int height = terminal_height - 1; |
|
|
|
const int height = terminal_height - 1; |
|
|
|
const wchar_t *bar_heights[] = {L"\u2581", L"\u2582", L"\u2583", L"\u2584", |
|
|
|
const wchar_t* bar_heights[] = {L"", L"\uE0B8", L"\uE0B9", |
|
|
|
L"\u2585", L"\u2586", L"\u2587", L"\u2588"}; |
|
|
|
L"\uE0BA", L"\uE0BB", L"\uE0BC", L"\uE0BD", L"\uE0BE"}; |
|
|
|
int num_bar_heights = (sizeof(bar_heights) / sizeof(bar_heights[0])); |
|
|
|
int num_bar_heights = (sizeof(bar_heights) / sizeof(bar_heights[0])); |
|
|
|
|
|
|
|
|
|
|
|
// output: check if terminal has been resized
|
|
|
|
// output: check if terminal has been resized
|
|
|
|
|