A library for working with phylogenetic and population genetic data.
v0.27.0
names.cpp File Reference
#include "genesis/utils/tools/color/names.hpp"
#include "genesis/utils/tools/color/functions.hpp"
#include "genesis/utils/text/string.hpp"
#include <algorithm>
#include <iterator>
#include <stdexcept>
#include <vector>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Typedefs

using NamedColorList = std::vector< std::pair< std::string, ColorBytes > >
 

Functions

Color color_from_name (std::string const &name)
 Return the color represented by the given name, which is (currently) a shortcut for color_from_name_web() and color_from_name_xkcd(). More...
 
Color color_from_name_web (std::string const &name)
 Retrieve a named web color by name. More...
 
Color color_from_name_xkcd (std::string const &name)
 Retrieve a named xkcd color by name. More...
 
std::vector< Color > color_palette_web ()
 
std::vector< Color > color_palette_xkcd ()
 
static std::vector< Color > convert_to_palette_ (NamedColorList const &list)
 Local helper function to convert a list of byte colors into a proper Color vector. More...
 
static NamedColorList::const_iterator get_color_list_iterator_ (NamedColorList const &list, std::string name)
 Internal helper function. More...
 
bool is_color_name (std::string const &name)
 Return true if the name represents one of the named colors offered by genesis, which is (currently) a shortcut for is_web_color_name() and is_xkcd_color_name(). More...
 
bool is_web_color_name (std::string const &name)
 Return true iff the given name is a named web color. More...
 
bool is_xkcd_color_name (std::string const &name)
 Return true iff the given name is a named xkcd color. More...
 

Variables

const NamedColorList color_list_web_
 Struct that stores a static const map of named web colors. More...
 
const NamedColorList color_list_xkcd_
 Struct that stores a static const map of named xkcd colors. More...