static bool load_theme(RCore *core, const char *path) { core->cmdfilter = "ec "; bool res = r_core_cmd_file (core, path); r_cons_pal_update_event (); core->cmdfilter = NULL; return res; }
R_API void r_cons_pal_random() { int i; RColor *rcolor; for (i = 0; keys[i].name; i++) { rcolor = RCOLOR_AT (i); *rcolor = r_cons_color_random (ALPHA_FG); } r_cons_pal_update_event (); }
static bool load_theme(RCore *core, const char *path) { if (!r_file_exists (path)) { return false; } core->cmdfilter = "ec "; bool res = r_core_cmd_file (core, path); if (res) { r_cons_pal_update_event (); } core->cmdfilter = NULL; return res; }
R_API void r_cons_pal_init() { RCons *cons = r_cons_singleton (); memset (&cons->cpal, 0, sizeof (cons->cpal)); memset (&cons->pal, 0, sizeof (cons->pal)); cons->cpal.b0x00 = (RColor) RColor_GREEN; cons->cpal.b0x7f = (RColor) RColor_CYAN; cons->cpal.b0xff = (RColor) RColor_RED; cons->cpal.args = (RColor) RColor_YELLOW; cons->cpal.bin = (RColor) RColor_CYAN; cons->cpal.btext = (RColor) RColor_YELLOW; cons->cpal.call = (RColor) RColor_GREEN; cons->cpal.call.attr = R_CONS_ATTR_BOLD; cons->cpal.cjmp = (RColor) RColor_GREEN; cons->cpal.cmp = (RColor) RColor_CYAN; cons->cpal.comment = (RColor) RColor_RED; cons->cpal.usercomment = (RColor) RColor_WHITE; cons->cpal.creg = (RColor) RColor_CYAN; cons->cpal.flag = (RColor) RColor_CYAN; cons->cpal.fline = (RColor) RColor_CYAN; cons->cpal.floc = (RColor) RColor_CYAN; cons->cpal.flow = (RColor) RColor_CYAN; cons->cpal.flow2 = (RColor) RColor_BLUE; cons->cpal.fname = (RColor) RColor_RED; cons->cpal.help = (RColor) RColor_GREEN; cons->cpal.input = (RColor) RColor_WHITE; cons->cpal.invalid = (RColor) RColor_RED; cons->cpal.invalid.attr = R_CONS_ATTR_BOLD; cons->cpal.jmp = (RColor) RColor_GREEN; cons->cpal.label = (RColor) RColor_CYAN; cons->cpal.math = (RColor) RColor_YELLOW; cons->cpal.mov = (RColor) RColor_WHITE; cons->cpal.nop = (RColor) RColor_BLUE; cons->cpal.num = (RColor) RColor_YELLOW; cons->cpal.offset = (RColor) RColor_GREEN; cons->cpal.other = (RColor) RColor_WHITE; cons->cpal.pop = (RColor) RColor_MAGENTA; cons->cpal.pop.attr = R_CONS_ATTR_BOLD; cons->cpal.prompt = (RColor) RColor_YELLOW; cons->cpal.push = (RColor) RColor_MAGENTA; cons->cpal.crypto = (RColor) RColor_BGBLUE; cons->cpal.reg = (RColor) RColor_CYAN; cons->cpal.ret = (RColor) RColor_RED; cons->cpal.swi = (RColor) RColor_MAGENTA; cons->cpal.trap = (RColor) RColor_RED; cons->cpal.trap.attr = R_CONS_ATTR_BOLD; cons->cpal.ai_read = (RColor) RColor_GREEN; cons->cpal.ai_write = (RColor) RColor_BLUE; cons->cpal.ai_exec = (RColor) RColor_RED; cons->cpal.ai_seq = (RColor) RColor_MAGENTA; cons->cpal.ai_ascii = (RColor) RColor_YELLOW; cons->cpal.gui_cflow = (RColor) RColor_YELLOW; cons->cpal.gui_dataoffset = (RColor) RColor_YELLOW; cons->cpal.gui_background = (RColor) RColor_BLACK; cons->cpal.gui_alt_background = (RColor) RColor_WHITE; cons->cpal.gui_border = (RColor) RColor_BLACK; cons->cpal.wordhl = (RColor) RColor_BGRED; cons->cpal.linehl = (RColor) RCOLOR (ALPHA_BG, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00); cons->cpal.func_var = (RColor) RColor_WHITE; cons->cpal.func_var_type = (RColor) RColor_BLUE; cons->cpal.func_var_addr = (RColor) RColor_CYAN; cons->cpal.widget_bg = (RColor) RCOLOR (ALPHA_BG, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00); cons->cpal.widget_sel = (RColor) RColor_BGRED; cons->cpal.graph_box = (RColor) RColor_NULL; cons->cpal.graph_box2 = (RColor) RColor_BLUE; cons->cpal.graph_box3 = (RColor) RColor_MAGENTA; cons->cpal.graph_box4 = (RColor) RColor_GRAY; cons->cpal.graph_true = (RColor) RColor_GREEN; cons->cpal.graph_false = (RColor) RColor_RED; cons->cpal.graph_trufae = (RColor) RColor_BLUE; // single jump cons->cpal.graph_traced = (RColor) RColor_YELLOW; cons->cpal.graph_current = (RColor) RColor_BLUE; cons->pal.rainbow = NULL; cons->pal.rainbow_sz = 0; r_cons_pal_free (); cons->pal.reset = Color_RESET; // reset is not user accessible, const char* is ok r_cons_pal_update_event (); }