src/lemon/graph_to_eps.h
changeset 1184 aad134c6c9c5
parent 1178 3c176c65d33b
child 1202 da44ee225dad
equal deleted inserted replaced
11:d5f5a09e1e0b 12:f5ccc6e9c69b
   155 ///Returns black for light colors and white for the dark ones.
   155 ///Returns black for light colors and white for the dark ones.
   156 
   156 
   157 ///Returns black for light colors and white for the dark ones.
   157 ///Returns black for light colors and white for the dark ones.
   158 ///\todo weighted average would be better
   158 ///\todo weighted average would be better
   159 inline Color distantBW(const Color &c){
   159 inline Color distantBW(const Color &c){
   160   double v=(c.getR()+c.getR()+c.getR())<1.5?1:0;
   160   //  double v=(c.getR()+c.getG()+c.getB())<1.5?1:0;
   161   
   161   double v=(.2125*c.getR()+.7154*c.getG()+.0721*c.getB())<.5?1:0;
   162   return Color(v,v,v);
   162   return Color(v,v,v);
   163 }
   163 }
   164 
   164 
   165 ///Default traits class of \ref GraphToEps
   165 ///Default traits class of \ref GraphToEps
   166 
   166