1 /++ 2 D wrappers for the C functions 3 4 Authors: Matthew Soucy, msoucy@csh.rit.edu 5 License: Subject to the terms of the MIT license, as written in the included LICENSE file. 6 +/ 7 module fabd.fab; 8 9 extern(C): 10 11 /// Wrap a color or special effect 12 enum Color { 13 BOLD, 14 ITALIC, 15 UNDER, 16 UNDER2, 17 STRIKE, 18 BLINK, 19 FLIP, 20 BLACK, 21 RED, 22 GREEN, 23 YELLOW, 24 BLUE, 25 MAGENTA, 26 CYAN, 27 WHITE, 28 HBLACK, 29 HRED, 30 HGREEN, 31 HYELLOW, 32 HBLUE, 33 HMAGENTA, 34 HCYAN, 35 HWHITE, 36 BGBLACK, 37 BGRED, 38 BGGREEN, 39 BGYELLOW, 40 BGBLUE, 41 BGMAGENTA, 42 BGCYAN, 43 BGWHITE 44 } 45 46 /// Wrap an RGB color value 47 struct rgb_t { 48 int r; 49 int g; 50 int b; 51 } 52 53 54 char* apply_color(Color c, const(char)* line); 55 56 char* foreground_256(rgb_t color, const(char)* line); 57 char* background_256(rgb_t color, const(char)* line); 58 char* highlight_256(rgb_t color, const(char)* line); 59 60 struct xcolor_image_t {} 61 62 int xterm_to_rgb_i(int); 63 xcolor_image_t* image_to_xterm(const(char)*); 64 char* image_to_string(const(xcolor_image_t)*); 65 void xcolor_image_free(xcolor_image_t*); 66