2000-02-10 17:53:36 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
2007-04-26 17:34:20 +00:00
|
|
|
|
* \file Color.h
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Asger Alstrup
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Matthias Ettrich
|
|
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
|
* \author Angus Leeming
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
* \author Martin Vermeer
|
2000-02-10 17:53:36 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
2000-02-10 17:53:36 +00:00
|
|
|
|
|
2009-03-17 13:23:54 +00:00
|
|
|
|
#ifndef COLOR_H
|
|
|
|
|
#define COLOR_H
|
2000-02-10 17:53:36 +00:00
|
|
|
|
|
2007-10-25 12:41:02 +00:00
|
|
|
|
#include "ColorCode.h"
|
|
|
|
|
|
2007-10-31 22:40:34 +00:00
|
|
|
|
#include "support/strfwd.h"
|
2006-12-21 14:31:19 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2009-03-14 20:41:04 +00:00
|
|
|
|
/**
|
|
|
|
|
* \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);
|
|
|
|
|
|
2007-08-12 11:08:51 +00:00
|
|
|
|
std::string const X11hexname(RGBColor const & col);
|
2007-11-02 23:42:27 +00:00
|
|
|
|
RGBColor rgbFromHexName(std::string const & x11hexname);
|
2007-08-12 11:08:51 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2009-03-17 13:23:54 +00:00
|
|
|
|
#endif // COLOR_H
|