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
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Lars Gullik Bjønnes
|
2003-08-23 00:17:00 +00:00
|
|
|
* \author Matthias Ettrich
|
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
* \author Angus Leeming
|
|
|
|
* \author John Levon
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-23 00:17:00 +00:00
|
|
|
* \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-02-09 23:30:24 +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-02-09 20:00:31 +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);
|
2010-01-27 18:10:33 +00:00
|
|
|
|
|
|
|
/// \name Comparison operators
|
2009-02-09 20:00:31 +00:00
|
|
|
//@{
|
|
|
|
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);
|
2009-04-11 21:40:11 +00:00
|
|
|
std::string const outputLaTeXColor(RGBColor const & color);
|
2011-01-14 20:00:55 +00:00
|
|
|
/// Inverse of outputLaTeXColor
|
|
|
|
RGBColor const RGBColorFromLaTeX(std::string const & color);
|
2021-01-19 16:04:04 +00:00
|
|
|
/// Inverted color
|
|
|
|
RGBColor const inverseRGBColor(RGBColor color);
|
2007-08-12 11:08:51 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
2009-02-09 23:30:24 +00:00
|
|
|
#endif // COLOR_H
|