A library for working with phylogenetic and population genetic data.
v0.32.0
names.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_UTILS_COLOR_NAMES_H_
2 #define GENESIS_UTILS_COLOR_NAMES_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2024 Lucas Czech
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@sund.ku.dk>
23  University of Copenhagen, Globe Institute, Section for GeoGenetics
24  Oster Voldgade 5-7, 1350 Copenhagen K, Denmark
25 */
26 
35 
36 #include <utility>
37 #include <string>
38 #include <vector>
39 
40 namespace genesis {
41 namespace utils {
42 
43 // =================================================================================================
44 // Color Names
45 // =================================================================================================
46 
51 bool is_color_name( std::string const& name );
52 
57 Color color_from_name( std::string const& name );
58 
59 // =================================================================================================
60 // Color Names Web
61 // =================================================================================================
62 
63 std::vector<Color> color_palette_web();
64 
70 bool is_color_name_web( std::string const& name );
71 
78 Color color_from_name_web( std::string const& name );
79 
80 // =================================================================================================
81 // Color Names xkcd
82 // =================================================================================================
83 
84 std::vector<Color> color_palette_xkcd();
85 
92 bool is_color_name_xkcd( std::string const& name );
93 
106 Color color_from_name_xkcd( std::string const& name );
107 
108 // =================================================================================================
109 // Color Names LEGO
110 // =================================================================================================
111 
112 std::vector<Color> color_palette_lego();
113 
120 bool is_color_name_lego( std::string const& name );
121 
135 Color color_from_name_lego( std::string const& name );
136 
137 } // namespace utils
138 } // namespace genesis
139 
140 #endif // include guard
genesis::utils::color_from_name_web
Color color_from_name_web(std::string const &name)
Retrieve a named web color by name.
Definition: names.cpp:1542
genesis::utils::color_from_name
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_w...
Definition: names.cpp:1518
genesis::utils::color_from_name_xkcd
Color color_from_name_xkcd(std::string const &name)
Retrieve a named xkcd color by name.
Definition: names.cpp:1567
genesis::utils::is_color_name_web
bool is_color_name_web(std::string const &name)
Return true iff the given name is a named web color.
Definition: names.cpp:1537
genesis::utils::color_from_name_lego
Color color_from_name_lego(std::string const &name)
Retrieve a named LEGO color by name.
Definition: names.cpp:1592
genesis::utils::color_palette_xkcd
std::vector< Color > color_palette_xkcd()
Definition: names.cpp:1578
genesis::utils::color_palette_web
std::vector< Color > color_palette_web()
Definition: names.cpp:1553
genesis
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Definition: placement/formats/edge_color.cpp:42
genesis::utils::is_color_name_xkcd
bool is_color_name_xkcd(std::string const &name)
Return true iff the given name is a named xkcd color.
Definition: names.cpp:1562
color.hpp
Header of Color class.
genesis::utils::is_color_name_lego
bool is_color_name_lego(std::string const &name)
Return true iff the given name is a named LEGO color.
Definition: names.cpp:1587
genesis::utils::color_palette_lego
std::vector< Color > color_palette_lego()
Definition: names.cpp:1603
genesis::utils::is_color_name
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...
Definition: names.cpp:1504