~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

Viewing changes to wxPython/wx/tools/Editra/src/eclib/eclutil.py

  • Committer: Package Import Robot
  • Author(s): Stéphane Graber
  • Date: 2012-01-07 13:59:25 UTC
  • mfrom: (1.1.9) (5.1.10 sid)
  • Revision ID: package-import@ubuntu.com-20120107135925-2601miy9ullcon9j
Tags: 2.8.12.1-6ubuntu1
* Resync from Debian, changes that were kept:
  - debian/rules: re-enable mediactrl. This allows libwx_gtk2u_media-2.8 to be
    built, as this is required by some applications (LP: #632984)
  - debian/control: Build-dep on libxt-dev for mediactrl.
  - Patches
    + fix-bashism-in-example
* Add conflict on python-wxgtk2.8 (<< 2.8.12.1-6ubuntu1~) to python-wxversion
  to guarantee upgrade ordering when moving from pycentral to dh_python2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
"""
15
15
 
16
16
__author__ = "Cody Precord <cprecord@editra.org>"
17
 
__svnid__ = "$Id: eclutil.py 63517 2010-02-19 02:44:37Z CJP $"
18
 
__revision__ = "$Revision: 63517 $"
 
17
__svnid__ = "$Id: eclutil.py 67596 2011-04-24 20:05:20Z CJP $"
 
18
__revision__ = "$Revision: 67596 $"
19
19
 
20
20
__all__ = ['AdjustAlpha', 'AdjustColour', 'BestLabelColour', 'HexToRGB',
21
21
           'GetHighlightColour', 'EmptyBitmapRGBA',
69
69
    @keyword alpha: amount to adjust alpha channel
70
70
 
71
71
    """
72
 
    radj, gadj, badj = [ int(val * (abs(percent) / 100.))
 
72
    radj, gadj, badj = [ int(val * (abs(percent) / 100.0))
73
73
                         for val in color.Get() ]
74
74
 
75
75
    if percent < 0:
88
88
    @param color: background color that text will be drawn on
89
89
 
90
90
    """
91
 
    avg = sum(color.Get()) / 3
 
91
    avg = sum(color.Get()) // 3
92
92
    if avg > 192:
93
93
        txt_color = wx.BLACK
94
94
    elif avg > 128: