graph_displayer_canvas-event.cc
changeset 200 c7ae8642a8d8
parent 194 6b2b718420eb
child 201 879e47e5b731
equal deleted inserted replaced
49:103f6d9b0860 50:353c35abab3d
   939       //within its 1/6 long phase the relativ position
   939       //within its 1/6 long phase the relativ position
   940       //determines the power of the color changed in
   940       //determines the power of the color changed in
   941       //that phase
   941       //that phase
   942       //we normalize that to one, to be able to give percentage
   942       //we normalize that to one, to be able to give percentage
   943       //value for the function
   943       //value for the function
   944       double rel_pos=(pos-(phase/6))*6;
   944       double rel_pos=(pos-(phase/6.0))*6.0;
   945 
   945 
   946       switch(phase)
   946       switch(phase)
   947 	{
   947 	{
   948 	case 0:
   948 	case 0:
   949 	  color.set_rgb_p (1, 0, 1-rel_pos);
   949 	  color.set_rgb_p (1, 0, 1-rel_pos);
   959 	  break;
   959 	  break;
   960 	case 4:
   960 	case 4:
   961 	  color.set_rgb_p (0, 1-rel_pos, 1);
   961 	  color.set_rgb_p (0, 1-rel_pos, 1);
   962 	  break;
   962 	  break;
   963 	case 5:
   963 	case 5:
   964 	  color.set_rgb_p ((rel_pos/3), 0, 1);
   964 	  color.set_rgb_p ((rel_pos/3.0), 0, 1);
   965 	  break;
   965 	  break;
   966 	default:
   966 	default:
   967 	  std::cout << "Wrong phase: " << phase << " " << pos << std::endl;
   967 	  std::cout << "Wrong phase: " << phase << " " << pos << std::endl;
   968 	}
   968 	}
   969     }
   969     }