4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Asger Alstrup
8 * \author Lars Gullik Bjønnes
9 * \author Matthias Ettrich
10 * \author Jean-Marc Lasgouttes
11 * \author Angus Leeming
13 * \author André Pönitz
14 * \author Martin Vermeer
16 * Full author contact details are available in file CREDITS.
22 #include "ColorCode.h"
24 #include "support/strfwd.h"
31 * A class holding a definition of a certain color.
33 * A color can be one of the following kinds:
35 * - a single color, then mergeColor = Color_ignore
36 * - a merged color, i.e. the average of the base and merge colors.
43 Color(ColorCode base_color = Color_none);
45 /// \name Comparison operators
47 bool operator==(Color const & color) const;
48 bool operator!=(Color const & color) const;
49 bool operator<(Color const & color) const;
50 bool operator<=(Color const & color) const;
55 /// The color that is merged with the base color. Set
56 /// mergeColor to Color_ignore if no merging is wanted.
60 std::ostream & operator<<(std::ostream & os, Color color);
62 std::string const X11hexname(RGBColor const & col);
63 RGBColor rgbFromHexName(std::string const & x11hexname);
64 std::string const outputLaTeXColor(RGBColor const & color);
65 /// Inverse of outputLaTeXColor
66 RGBColor const RGBColorFromLaTeX(std::string const & color);
68 RGBColor const inverseRGBColor(RGBColor color);