|
C-Menu 0.2.9
A User Interface Toolkit
|
Conversion of Color Data Types and Management of Colors and Color Pairs. More...
Functions | |
| int | get_clr_pair (int fg, int bg) |
| Get color pair index for foreground and background colors. | |
| int | rgb_to_curses_clr (RGB *rgb) |
| Get color index for RGB color. | |
| int | rgb_to_xterm256_idx (RGB *rgb) |
| Convert RGB color to XTerm 256 color index. | |
| RGB | xterm256_idx_to_rgb (int idx) |
| Convert XTerm 256 color index to RGB color. | |
| void | apply_gamma (RGB *rgb) |
| Apply gamma correction to RGB color. | |
| bool | init_clr_palette (SIO *sio) |
| Initialize color palette based on SIO settings. | |
| void | init_hex_clr (int idx, char *s) |
| Initialize extended ncurses color from HTML style hex string. | |
| RGB | hex_clr_str_to_rgb (char *s) |
| Convert six-digit HTML style hex color code to RGB struct. | |
| cchar_t | mkccc (int cp) |
| Create a cchar_t with the specified color pair index. | |
| int | clr_name_to_idx (char *s) |
| Get color index from color name. | |
| void | list_colors () |
| list colors to stderr | |
Conversion of Color Data Types and Management of Colors and Color Pairs.
| void apply_gamma | ( | RGB * | rgb | ) |
Apply gamma correction to RGB color.
| rgb | Pointer to RGB color |
Definition at line 624 of file dwin.c.
References RGB::b, BLUE_GAMMA, RGB::g, GRAY_GAMMA, GREEN_GAMMA, RGB::r, and RED_GAMMA.
Referenced by init_hex_clr(), and rgb_to_curses_clr().
| int clr_name_to_idx | ( | char * | s | ) |
Get color index from color name.
| s | Color name |
Definition at line 1282 of file dwin.c.
References colors_text, and str_to_lower().
| int get_clr_pair | ( | int | fg, |
| int | bg ) |
Get color pair index for foreground and background colors.
| fg | Foreground color index |
| bg | Background color index |
Definition at line 510 of file dwin.c.
References clr_pair_cnt, display_error(), em0, em1, em2, and ssnprintf().
Referenced by open_curses(), and parse_ansi_str().
| RGB hex_clr_str_to_rgb | ( | char * | s | ) |
| bool init_clr_palette | ( | SIO * | sio | ) |
Initialize color palette based on SIO settings.
| sio | Pointer to SIO struct with color settings |
Definition at line 651 of file dwin.c.
References SIO::bblack, SIO::bblue, SIO::bcyan, SIO::bg_clr_x, SIO::bgreen, SIO::black, SIO::blue, SIO::bmagenta, SIO::bo_clr_x, SIO::borange, SIO::bred, SIO::bwhite, SIO::byellow, CLR_BBLACK, CLR_BBLUE, CLR_BCYAN, CLR_BG, CLR_BGREEN, CLR_BLACK, CLR_BLUE, CLR_BMAGENTA, CLR_BO, CLR_BORANGE, CLR_BRED, CLR_BWHITE, CLR_BYELLOW, clr_cnt, CLR_CYAN, CLR_FG, CLR_GREEN, CLR_LN, CLR_LN_BG, CLR_MAGENTA, CLR_NCOLORS, CLR_RED, CLR_WHITE, CLR_YELLOW, SIO::cyan, SIO::fg_clr_x, SIO::green, init_hex_clr(), SIO::ln_bg_clr_x, SIO::ln_clr_x, SIO::magenta, SIO::red, SIO::white, and SIO::yellow.
Referenced by open_curses().
| void init_hex_clr | ( | int | idx, |
| char * | s ) |
Initialize extended ncurses color from HTML style hex string.
| idx | Color index |
| s | Hex color string |
Definition at line 708 of file dwin.c.
References apply_gamma(), RGB::b, RGB::g, hex_clr_str_to_rgb(), RGB::r, and StdColors.
Referenced by init_clr_palette().
| void list_colors | ( | ) |
list colors to stderr
Definition at line 1300 of file dwin.c.
References colors_text.
| cchar_t mkccc | ( | int | cp | ) |
Create a cchar_t with the specified color pair index.
| cp | Color pair index |
Definition at line 766 of file dwin.c.
Referenced by open_curses().
| int rgb_to_curses_clr | ( | RGB * | rgb | ) |
Get color index for RGB color.
| rgb | RGB color |
Definition at line 541 of file dwin.c.
References apply_gamma(), RGB::b, clr_cnt, RGB::g, and RGB::r.
Referenced by parse_ansi_str().
| int rgb_to_xterm256_idx | ( | RGB * | rgb | ) |
Convert RGB color to XTerm 256 color index.
| rgb | RGB color |
Definition at line 569 of file dwin.c.
| RGB xterm256_idx_to_rgb | ( | int | idx | ) |
Convert XTerm 256 color index to RGB color.
| idx | XTerm 256 color index |
Convert XTerm 256 color index to RGB
| idx | - XTerm 256 color index |
Definition at line 590 of file dwin.c.
References RGB::b, RGB::g, RGB::r, and StdColors.
Referenced by parse_ansi_str().