From: Robin Dunn Date: Wed, 24 Sep 2003 20:24:51 +0000 (+0000) Subject: float --> int fixes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4c5304540d95b61f708810e3be5e224e3a0f7906 float --> int fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wxPython/lib/colourchooser/pycolourbox.py b/wxPython/wxPython/lib/colourchooser/pycolourbox.py index e48bdc373a..941c619a0e 100644 --- a/wxPython/wxPython/lib/colourchooser/pycolourbox.py +++ b/wxPython/wxPython/lib/colourchooser/pycolourbox.py @@ -57,7 +57,7 @@ class PyColourBox(wxPanel): def SetColourTuple(self, colour): """Sets the box's current couple to the given tuple.""" self.colour = colour - self.colour_box.SetBackgroundColour(apply(wxColour, self.colour)) + self.colour_box.SetBackgroundColour(wxColour(*self.colour)) def Update(self): wxPanel.Update(self) diff --git a/wxPython/wxPython/lib/colourchooser/pycolourslider.py b/wxPython/wxPython/lib/colourchooser/pycolourslider.py index 17cab48e8f..87a4442579 100644 --- a/wxPython/wxPython/lib/colourchooser/pycolourslider.py +++ b/wxPython/wxPython/lib/colourchooser/pycolourslider.py @@ -76,7 +76,7 @@ class PyColourSlider(canvas.Canvas): vstep = 1.0 / self.HEIGHT for y_pos in range(0, self.HEIGHT): r,g,b = [c * 255.0 for c in colorsys.hsv_to_rgb(h,s,v)] - colour = wxColour(int(r), int(g),(b)) + colour = wxColour(int(r), int(g), int(b)) self.buffer.SetPen(wxPen(colour, 1, wxSOLID)) self.buffer.DrawRectangle(0, y_pos, 15, 1) v = v - vstep diff --git a/wxPython/wxPython/lib/colourchooser/pypalette.py b/wxPython/wxPython/lib/colourchooser/pypalette.py index 3cbbfeeb49..8b137d4e6d 100644 --- a/wxPython/wxPython/lib/colourchooser/pypalette.py +++ b/wxPython/wxPython/lib/colourchooser/pypalette.py @@ -201,7 +201,7 @@ class PyPalette(canvas.Canvas): for x in range(0, width, self.HORIZONTAL_STEP): hue = float(x) / float(width) r,g,b = colorsys.hsv_to_rgb(hue, saturation, value) - colour = wxColour(r * 255.0, g * 255.0, b * 255.0) + colour = wxColour(int(r * 255.0), int(g * 255.0), int(b * 255.0)) self.buffer.SetPen(wxPen(colour, 1, wxSOLID)) self.buffer.SetBrush(wxBrush(colour, wxSOLID)) self.buffer.DrawRectangle(x, y, diff --git a/wxPython/wxPython/lib/imageutils.py b/wxPython/wxPython/lib/imageutils.py index 7636508194..d2cd60e037 100644 --- a/wxPython/wxPython/lib/imageutils.py +++ b/wxPython/wxPython/lib/imageutils.py @@ -40,6 +40,6 @@ def makeGray((r,g,b), factor, maskColor): changed. """ if (r,g,b) != maskColor: - return map(lambda x: ((230 - x) * factor) + x, (r,g,b)) + return map(lambda x: int((230 - x) * factor) + x, (r,g,b)) else: return (r,g,b)