]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Color.h
Swap two printer related help messages.
[lyx.git] / src / frontends / xforms / Color.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1995 Matthias Ettrich
8  *          Copyright 1995-2000 The LyX Team.
9  *
10  *======================================================*/
11
12 #ifndef COLOR_H
13 #define COLOR_H
14
15 #ifdef __GNUG_
16 #pragma interface
17 #endif
18
19 #include "LString.h"
20
21 struct RGBColor;
22
23 struct HSVColor {
24         double h;
25         double s;
26         double v;
27         HSVColor() : h(0.0), s(0.0), v(0.0) {}
28         HSVColor(double hue, double sat, double val)
29                 : h(hue), s(sat), v(val) {}
30         HSVColor(RGBColor const &);
31 };
32
33 struct RGBColor {
34         int r;
35         int g;
36         int b;
37         RGBColor() : r(0), g(0), b(0) {}
38         RGBColor(int red, int green, int blue)
39                 : r(red), g(green), b(blue) {}
40         RGBColor(HSVColor const &);
41 };
42
43 struct NamedColor : public RGBColor {
44         string name;
45         NamedColor() : RGBColor() {}
46         NamedColor(string const & n, RGBColor const & c )
47                 : RGBColor(c), name(n) {}
48         RGBColor const & color() const { return *this; }
49         string const & getname() const { return name; }
50 };
51
52 inline
53 bool operator==(RGBColor const & c1, RGBColor const & c2)
54 {
55         return (c1.r == c2.r && c1.g == c2.g && c1.b == c2.b);
56 }
57
58
59 inline
60 bool operator!=(RGBColor const & c1, RGBColor const & c2)
61 {
62         return !(c1 == c2);
63 }
64
65 #endif