/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to viz/graphcell.py

  • Committer: Gary van der Merwe
  • Date: 2007-09-20 20:51:09 UTC
  • mto: (256.2.54 gtk)
  • mto: This revision was merged to the branch mainline in revision 289.
  • Revision ID: garyvdm@gmail.com-20070920205109-hzq89u6gu2vod2h1
Make the mainline allways black - which often makes the graph easier to read.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
        colours and the fg parameter provides the multiplier that should be
85
85
        applied to the foreground colours.
86
86
        """
 
87
        mainline_color = ( 0.0, 0.0, 0.0 )
87
88
        colours = [
88
89
            ( 1.0, 0.0, 0.0 ),
89
90
            ( 1.0, 1.0, 0.0 ),
93
94
            ( 1.0, 0.0, 1.0 ),
94
95
            ]
95
96
 
96
 
        colour %= len(colours)
97
 
        red   = (colours[colour][0] * fg) or bg
98
 
        green = (colours[colour][1] * fg) or bg
99
 
        blue  = (colours[colour][2] * fg) or bg
 
97
        if colour == 0:
 
98
            colour_rgb = mainline_color
 
99
        else:
 
100
            colour_rgb = colours[colour % len(colours)]
 
101
 
 
102
        red   = (colour_rgb[0] * fg) or bg
 
103
        green = (colour_rgb[1] * fg) or bg
 
104
        blue  = (colour_rgb[2] * fg) or bg
100
105
 
101
106
        ctx.set_source_rgb(red, green, blue)
102
107