]> git.saurik.com Git - wxWidgets.git/commitdiff
float --> int fixes
authorRobin Dunn <robin@alldunn.com>
Wed, 24 Sep 2003 20:24:51 +0000 (20:24 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 24 Sep 2003 20:24:51 +0000 (20:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wxPython/lib/colourchooser/pycolourbox.py
wxPython/wxPython/lib/colourchooser/pycolourslider.py
wxPython/wxPython/lib/colourchooser/pypalette.py
wxPython/wxPython/lib/imageutils.py

index e48bdc373a3b090bcbdcd2fd776b7cc749eb2d1e..941c619a0e3c9834e9b486f0b36d4fdca0e84a01 100644 (file)
@@ -57,7 +57,7 @@ class PyColourBox(wxPanel):
     def SetColourTuple(self, colour):
         """Sets the box's current couple to the given tuple."""
         self.colour = colour
     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)
 
     def Update(self):
         wxPanel.Update(self)
index 17cab48e8f71323d4bd86ee7ed8847dab3cde4a0..87a4442579305a1f5fc489757dbb78732e64d7a4 100644 (file)
@@ -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)]
         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
             self.buffer.SetPen(wxPen(colour, 1, wxSOLID))
             self.buffer.DrawRectangle(0, y_pos, 15, 1)
             v = v - vstep
index 3cbbfeeb49bd4538850896f044956159e4fca726..8b137d4e6df0a0a24538844dabfb4ae80a270174 100644 (file)
@@ -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)
             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,
                 self.buffer.SetPen(wxPen(colour, 1, wxSOLID))
                 self.buffer.SetBrush(wxBrush(colour, wxSOLID))
                 self.buffer.DrawRectangle(x, y,
index 7636508194b2b2ac2c4b50519efa16461fa68335..d2cd60e0373679f3e459f64ef1eb7cf4284ce7bc 100644 (file)
@@ -40,6 +40,6 @@ def makeGray((r,g,b), factor, maskColor):
     changed.
     """
     if (r,g,b) != 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)
     else:
         return (r,g,b)