Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.56
Color.h
Go to the documentation of this file.
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
18 
19 
20 #pragma once
21 
22 #include "common.h"
23 #if GEOM_PSEUDO3D==GEOM_TRUE
24  namespace GEOM_FADE25D {
25 #elif GEOM_PSEUDO3D==GEOM_FALSE
26  namespace GEOM_FADE2D {
27 #else
28  #error GEOM_PSEUDO3D is not defined
29 #endif
30 
34 {
35  CRED,
36  CGREEN,
37  CBLUE,
38  CBLACK,
39  CYELLOW,
40  CPINK,
41  CGRAY,
42  CWHITE,
43  CORANGE,
44  CLIGHTBLUE,
45  CLIGHTBROWN,
46  CDARKBROWN,
47  CPURPLE,
48  COLIVE,
49  CLAWNGREEN,
50  CPALEGREEN,
51  CCYAN
52 };
53 
58 class CLASS_DECLSPEC Color
59 {
60 public:
75  Color(double r_,double g_,double b_,double width_,bool bFill_=false);
76 
89  Color(Colorname c,float width_=0.001,bool bFill_=false);
90  Color();
91 
92  bool operator<(const Color& other) const;
93  bool operator!=(const Color& other) const;
94  bool operator==(const Color& other) const;
95  float r;
96  float g;
97  float b;
98  float width;
99  bool bFill;
100  friend std::ostream &operator<<(std::ostream &stream, const Color& c);
101 };
102 
103 
104 
105 inline std::ostream &operator<<(std::ostream &stream, const Color& c)
106 {
107  stream<<"Color (r,g,b): "<<c.r<<","<<c.g<<","<<c.b<<", linewidth="<<c.width<<", fill="<<c.bFill;
108  return stream;
109 }
110 
111 
112 } // (namespace)
float width
Linewidth.
Definition: Color.h:98
float g
Green.
Definition: Color.h:96
bool bFill
Fill the shape or not.
Definition: Color.h:99
float r
Red.
Definition: Color.h:95
Colorname
Predefined colors for convenience.
Definition: Color.h:33
Color.
Definition: Color.h:58
Definition: Bbox2.h:25
float b
Blue.
Definition: Color.h:97