#5604: average Color objects when adding them together
-------------------------+--------------------------------------------------
 Reporter:  jason        |         Owner:  was       
     Type:  enhancement  |        Status:  closed    
 Priority:  minor        |     Milestone:  sage-4.4.2
Component:  graphics     |    Resolution:  fixed     
 Keywords:               |        Author:            
 Upstream:  N/A          |      Reviewer:            
   Merged:               |   Work_issues:            
-------------------------+--------------------------------------------------
Changes (by mvngu):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 This looks like fixed, but the averaging operator "+" is binary:
 {{{
 [mv...@sage ~]$ sage
 ----------------------------------------------------------------------
 | Sage Version 4.4.1, Release Date: 2010-05-02                       |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 sage: r = sage.plot.colors.red
 sage: g = sage.plot.colors.green
 sage: b = sage.plot.colors.blue
 sage: r; g; b
 RGB color (1.0, 0.0, 0.0)
 RGB color (0.0, 0.50196078431372548, 0.0)
 RGB color (0.0, 0.0, 1.0)
 sage: r + g; r + b
 RGB color (0.5, 0.25098039215686274, 0.0)
 RGB color (0.5, 0.0, 0.5)
 sage: (r + g) + b; r + g + b
 RGB color (0.25, 0.12549019607843137, 0.5)
 RGB color (0.25, 0.12549019607843137, 0.5)
 sage: (r + b) + g; r + b + g
 RGB color (0.25, 0.25098039215686274, 0.25)
 RGB color (0.25, 0.25098039215686274, 0.25)
 sage: (g + b) + r; g + b + r
 RGB color (0.5, 0.12549019607843137, 0.25)
 RGB color (0.5, 0.12549019607843137, 0.25)
 }}}
 For more than two operands, I thought that "+" would average over the
 number of operands. Instead, "+" averages the first two, then average the
 result with the last operand.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5604#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to