Changeset 2174:f9e43b5cc617 in lemon-0.x
- Timestamp:
- 08/10/06 15:52:56 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2889
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/disjoint_paths_demo.cc
r2084 r2174 42 42 43 43 Color color(bool b) { 44 return b ? Color(1.0, 0.0, 0.0) : Color(0.0, 0.0, 0.0);44 return b ? RED : BLACK; 45 45 } 46 46 -
demo/strongly_connected_orientation.cc
r2173 r2174 46 46 47 47 Color color(bool c) { 48 return c ? Color(0.0, 0.0, 0.0) : Color(1.0, 0.0, 0.0);48 return c ? BLACK : RED; 49 49 } 50 50 -
demo/topology_demo.cc
r2172 r2174 41 41 42 42 Color color(bool val) { 43 return val ? Color(1.0, 0.0, 0.0) : Color(0.0, 0.0, 1.0);43 return val ? RED : BLUE; 44 44 } 45 45 -
lemon/Makefile.am
r2144 r2174 11 11 lemon/lp_skeleton.cc \ 12 12 lemon/base.cc \ 13 lemon/color.cc \ 13 14 lemon/eps.cc \ 14 15 lemon/bits/mingw32_rand.cc \ -
lemon/color.h
r2172 r2174 44 44 45 45 namespace lemon { 46 47 /// \addtogroup misc 48 /// @{ 46 49 47 50 ///Data structure representing RGB colors. … … 73 76 }; 74 77 78 /// White color constant 79 extern const Color WHITE; 80 /// Black color constant 81 extern const Color BLACK; 82 /// Red color constant 83 extern const Color RED; 84 /// Green color constant 85 extern const Color GREEN; 86 /// Blue color constant 87 extern const Color BLUE; 88 /// Yellow color constant 89 extern const Color YELLOW; 90 /// Magenta color constant 91 extern const Color MAGENTA; 92 /// Cyan color constant 93 extern const Color CYAN; 94 /// Grey color constant 95 extern const Color GREY; 96 /// Dark red color constant 97 extern const Color DARK_RED; 98 /// Dark green color constant 99 extern const Color DARK_GREEN; 100 /// Drak blue color constant 101 extern const Color DARK_BLUE; 102 /// Dark yellow color constant 103 extern const Color DARK_YELLOW; 104 /// Dark magenta color constant 105 extern const Color DARK_MAGENTA; 106 /// Dark cyan color constant 107 extern const Color DARK_CYAN; 108 75 109 ///Maps <tt>int</tt>s to different \ref Color "Color"s 76 110 … … 92 126 ///amongst the provided color (\c true) or not (\c false). If it is true, 93 127 ///white will be assigned to \c 0. 94 ///\param num the number of the allocated colors. If it is \c 0 95 ///the default color configuration is set up (26 color plus the whi le).128 ///\param num the number of the allocated colors. If it is \c 0, 129 ///the default color configuration is set up (26 color plus the white). 96 130 ///If \c num is less then 26/27 then the default color list is cut. Otherwise 97 131 ///the color list is filled repeatedly with the default color list. … … 168 202 ///Returns black for light colors and white for the dark ones. 169 203 inline Color distantBW(const Color &c){ 170 double v=(.2125*c.red()+.7154*c.green()+.0721*c.blue())<.5?1:0; 171 return Color(v,v,v); 204 return (.2125*c.red()+.7154*c.green()+.0721*c.blue())<.5 ? WHITE : BLACK; 172 205 } 173 206 207 /// @} 208 174 209 } //END OF NAMESPACE LEMON 175 210 -
lemon/eps.h
r2084 r2174 287 287 ///\param brd Color of the node border. The default color is black 288 288 EpsDrawer &node(NodeShapes t, double x, double y, double r, 289 Color col= Color(1,1,1), Color brd=Color(0,0,0));289 Color col=WHITE, Color brd=BLACK); 290 290 ///Draw a node shape 291 291 … … 298 298 template<class T> 299 299 EpsDrawer &node(NodeShapes t, xy<T> pos, double r, 300 Color col= Color(1,1,1), Color brd=Color(0,0,0))300 Color col=WHITE, Color brd=BLACK) 301 301 { 302 302 return node(t,pos.x,pos.y,r,col,brd); -
lemon/graph_to_eps.h
r2172 r2174 145 145 g(_g), os(_os), 146 146 _coords(xy<double>(1,1)), _nodeSizes(1.0), _nodeShapes(0), 147 _nodeColors( Color(1,1,1)), _edgeColors(Color(0,0,0)),147 _nodeColors(WHITE), _edgeColors(BLACK), 148 148 _edgeWidths(1), _edgeWidthScale(0.3), 149 149 _nodeScale(1.0), _xBorder(10), _yBorder(10), _scale(1.0), … … 156 156 _undirected(false), 157 157 _pleaseRemoveOsStream(_pros), _scaleToA4(false), 158 _nodeTextColorType(SAME_COL), _nodeTextColors( Color(0,0,0)),158 _nodeTextColorType(SAME_COL), _nodeTextColors(BLACK), 159 159 _autoNodeScale(false), 160 160 _autoEdgeWidthScale(false),
Note: See TracChangeset
for help on using the changeset viewer.