]> git.lyx.org Git - features.git/blobdiff - src/Color.h
Add a new Color class. This class makes it possible to specify a color as a merging...
[features.git] / src / Color.h
index 0f0a0934a356c633f0c754b4e3a4f1ca3ad07ebe..ec1a2d9ba476aed689a4799e4c4dace52107270e 100644 (file)
@@ -5,12 +5,12 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Asger Alstrup
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  * \author Matthias Ettrich
  * \author Jean-Marc Lasgouttes
  * \author Angus Leeming
  * \author John Levon
- * \author André Pönitz
+ * \author André Pönitz
  * \author Martin Vermeer
  *
  * Full author contact details are available in file CREDITS.
 
 namespace lyx {
 
+/**
+ * \class Color
+ *
+ * A class holding a definition of a certain color.
+ *
+ * A color can be one of the following kinds:
+ *
+ * - a single color, then mergeColor = Color_ignore
+ * - a merged color, i.e. the average of the base and merge colors.
+ */
+
+class Color
+{
+public:
+       ///
+       Color(ColorCode base_color = Color_none);
+       
+       /// comparison operators.
+       //@{
+       bool operator==(Color const & color) const;
+       bool operator!=(Color const & color) const;
+       bool operator<(Color const & color) const;
+       bool operator<=(Color const & color) const;
+       //@}
+
+       /// the base color
+       ColorCode baseColor;
+       /// The color that is merged with the base color. Set
+       /// mergeColor to Color_ignore if no merging is wanted.
+       ColorCode mergeColor;
+};
+
+std::ostream & operator<<(std::ostream & os, Color color);
+
+
 /**
  * \class ColorSet
  *