MCPcopy Create free account
hub / github.com/DFHack/dfhack / color

Method color

library/Console-posix.cpp:330–341  ·  view source on GitHub ↗

Set color (ANSI color number)

Source from the content-addressed store, hash-verified

328 }
329 /// Set color (ANSI color number)
330 void color(Console::color_value index)
331 {
332 if(!rawmode)
333 fprintf(dfout_C, "%s", getANSIColor(index));
334 else
335 {
336 const char * colstr = getANSIColor(index);
337 int lstr = strlen(colstr);
338 if (::write(STDIN_FILENO,colstr,lstr) == -1)
339 ;
340 }
341 }
342 /// Reset color to default
343 void reset_color(void)
344 {

Callers

nothing calls this directly

Calls 2

getANSIColorFunction · 0.85
writeFunction · 0.50

Tested by

no test coverage detected