* qt_helpers.cpp:
[lyx.git] / src / Color.h
blobfbfe10fb226385138c29b76ed63ff0435b1b4110
1 // -*- C++ -*-
2 /**
3 * \file Color.h
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
12 * \author John Levon
13 * \author André Pönitz
14 * \author Martin Vermeer
16 * Full author contact details are available in file CREDITS.
19 #ifndef COLOR_H
20 #define COLOR_H
22 #include "ColorCode.h"
24 #include "support/strfwd.h"
26 namespace lyx {
28 /**
29 * \class Color
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.
39 class Color
41 public:
42 ///
43 Color(ColorCode base_color = Color_none);
45 /// comparison operators.
46 //@{
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;
51 //@}
53 /// the base color
54 ColorCode baseColor;
55 /// The color that is merged with the base color. Set
56 /// mergeColor to Color_ignore if no merging is wanted.
57 ColorCode mergeColor;
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);
66 } // namespace lyx
68 #endif // COLOR_H