|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
60 [&name] ( std::pair<std::string, std::string>
const& elem ) {
78 [&name] ( std::pair<std::string, std::string>
const& elem ) {
143 if( foreground_ ==
"" ) {
165 if( background_ ==
"" ) {
199 std::vector<std::string> attribs;
202 attribs.push_back(
"1" );
211 return join( attribs,
";" );
236 if( attribs.size() > 0 ) {
252 if( attribs.size() > 0 ) {
286 throw std::out_of_range(
"No foreground color named " + name +
".");
303 {
"LightGray",
"37" },
304 {
"DarkGray",
"90" },
305 {
"LightRed",
"91" },
306 {
"LightGreen",
"92" },
307 {
"LightYellow",
"93" },
308 {
"LightBlue",
"94" },
309 {
"LightMagenta",
"95" },
310 {
"LightCyan",
"96" },
337 throw std::out_of_range(
"No background color named " + name +
".");
354 {
"LightGray",
"47" },
355 {
"DarkGray",
"100" },
356 {
"LightRed",
"101" },
357 {
"LightGreen",
"102" },
358 {
"LightYellow",
"103" },
359 {
"LightBlue",
"104" },
360 {
"LightMagenta",
"105" },
361 {
"LightCyan",
"106" },
384 out <<
"Bold: " << ( style.
bold() ?
"true" :
"false" ) <<
"\n";
static std::string get_background_color_value(std::string name)
Return the color value string for a given background color name.
static std::string get_attribute_string_(Style const &s)
Internal helper function that returns the attribute string of a Style based on its properties.
bool equals_ci(std::string const &lhs, std::string const &rhs)
Compare two strings, case insensitive.
std::string replace_all(std::string const &text, std::string const &search, std::string const &replace)
Return a copy of a string, where all occurrences of a search string are replaced by a replace string.
static bool is_background_color(std::string name)
Return true iff the given name is a background color name.
std::ostream & operator<<(std::ostream &os, Color const &color)
Write a textual representation of the Color the a stream, in the format "(r, g, b,...
std::string foreground_color() const
static const std::array< std::pair< std::string, std::string >, 17 > background_colors
List of all valid background color names and their color strings.
static std::string get_foreground_color_value(std::string name)
Return the color value string for a given foreground color name.
Provides some commonly used string utility functions.
static bool is_foreground_color(std::string name)
Return true iff the given name is a foreground color name.
std::string to_bash_string(std::string const &text) const
Additional output function with the same purpose as operator().
Simple text style class for colorized and bold output to a terminal.
static const std::array< std::pair< std::string, std::string >, 17 > foreground_colors
List of all valid foreground color names and their color strings.
Interval< DataType, NumericalType, IntervalKind > join(Interval< DataType, NumericalType, IntervalKind > const &a, Interval< DataType, NumericalType, IntervalKind > const &b)
Creates a new Interval that contains both intervals and whatever is between.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
std::string to_python_string(std::string const &text) const
Additional output function with the same purpose as operator().
bool enabled() const
Return whether the Style is currently enabled.
bool bold() const
Return whether the Style uses bold.
static std::array< std::pair< std::string, std::string >, 17 >::const_iterator get_foreground_color_iterator(std::string name)
Internal helper function that returns an iterator into the foreground color list.
std::string background_color() const
static std::array< std::pair< std::string, std::string >, 17 >::const_iterator get_background_color_iterator(std::string name)
Internal helper function that returns an iterator into the background color list.
Style & reset()
Reset the Style to use not colors and not bold.
std::string operator()(std::string const &text) const
Operator that returns a text with the current Style applied to it.