// -*- C++ -*-
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+/**
+ * \file Color.h
+ * Copyright 1995 Matthias Ettrich
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- *======================================================*/
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS
+ */
+
+/* structs RGBColor and HSVColor to enable simple conversion between
+ * color spaces.
+ */
#ifndef COLOR_H
#define COLOR_H
-#include <utility> // for pair
-
-#ifdef __GNUG_
+#ifdef __GNUG__
#pragma interface
#endif
RGBColor(HSVColor const &);
};
-typedef std::pair<string, RGBColor> X11Color;
-
-/// struct holding xform-specific colors
-struct XformColor {
+struct NamedColor : public RGBColor {
string name;
- int colorID;
- RGBColor col;
- XformColor() : colorID(0) {}
+ NamedColor() : RGBColor() {}
+ NamedColor(string const & n, RGBColor const & c)
+ : RGBColor(c), name(n) {}
+ RGBColor const & color() const { return *this; }
string const & getname() const { return name; }
- static bool read(string const &);
- static bool write(string const &);
};
inline