foxygit / ytmdl Log in
commits tags

/c/src/colors.h · 739 B

raw
#ifndef YTMDL_COLORS_H
#define YTMDL_COLORS_H

#include <ncurses.h>

enum {
    PAIR_BORDER = 1,
    PAIR_BORDER_FOCUS,
    PAIR_TITLE,
    PAIR_STATUS_PENDING,
    PAIR_STATUS_DOWNLOADING,
    PAIR_STATUS_DONE,
    PAIR_STATUS_ERROR,
    PAIR_PROGRESS_FILLED,
    PAIR_MSG_ERROR,
    PAIR_MSG_INFO,
};

/* Unicode block-element glyphs for progress bars (not Nerd-Font-specific;
 * broadly supported wherever UTF-8 is). */
#define BLOCK_FULL "█"
#define BLOCK_LIGHT "░"

/* Sets up color pairs. Safe to call even on a monochrome terminal (no-op). */
void colors_init(void);

/* Draws a box with rounded corners around win, in the given color pair
 * (or no color if pair <= 0). */
void draw_rounded_box(WINDOW *win, int pair);

#endif