Celeritas 0.7.0-dev.279+develop.84922c50
Loading...
Searching...
No Matches
Functions
ColorUtils.cc File Reference
#include "ColorUtils.hh"
#include <cstdio>
#include <cstdlib>
#include <string>
#include <unistd.h>
#include "corecel/Assert.hh"
#include "corecel/sys/Environment.hh"

Functions

bool celeritas::use_color ()
 Whether colors are enabled by the environment.
 
char constceleritas::ansi_color (char abbrev)
 Get an ANSI color codes if colors are enabled.
 

Function Documentation

◆ ansi_color()

char const * celeritas::ansi_color ( char  abbrev)

Get an ANSI color codes if colors are enabled.

  • [b]lue
  • [g]reen
  • [y]ellow
  • [r]ed
  • [x] gray
  • [R]ed bold
  • [W]hite bold
  • null reset color
  • [ ] reset color

◆ use_color()

bool celeritas::use_color ( )

Whether colors are enabled by the environment.

The NO_COLOR environment variable, if set to a non-empty value, disables color output. If either of the CELER_COLOR or GTEST_COLOR variables is set, that value will be used. Failing that, the default is true if stderr is a tty. The result of this value is used by ansi_color .