A toolkit for working with phylogenetic data.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
utils/tools/color/functions.hpp File Reference

Detailed Description

Color operators and functions.

Definition in file utils/tools/color/functions.hpp.

#include <iosfwd>
#include <map>
#include <string>
#include <vector>

Go to the source code of this file.


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


Color color_from_bytes (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
 Create a Color given three or four values in the range [ 0, 255 ] for each of the components red, green and blue, and optionally alpha. More...
Color color_from_hex (std::string const &hex_color, std::string const &prefix="#")
 Create a Color given a hex color string in the format "#003366[ff]". More...
std::string color_to_hex (Color const &c, std::string const &prefix="#", bool uppercase=false, bool with_alpha=false)
 Return a hex string representation of a Color in the format "#003366[ff]". More...
Color gradient (std::map< double, Color > const &ranges, double value)
 Returns a Color that is created using a color gradient. More...
Color heat_gradient (double percentage)
 Return a Color that represents a heat gradient for a given percentage value. More...
Color interpolate (Color const &color1, Color const &color2, double fraction)
 Linearily interpolate between two Colors. More...
std::ostream & operator<< (std::ostream &os, Color const &h)
 Write a textual representation of the Color the a stream, in the format "(r, g, b, a)". More...