git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23903
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
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)
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
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,
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))