Commit c2d8f573 authored by Barry Warsaw's avatar Barry Warsaw

__togglehex(): Simplify

parent c1c7b1a6
......@@ -58,18 +58,8 @@ class TypeinViewer:
self.__hex.grid(row=4, column=0, columnspan=2, sticky=W)
def __togglehex(self, event=None):
rstr = self.__x.get()
gstr = self.__y.get()
bstr = self.__z.get()
if self.__hexp.get():
# it was decimal and is now hex
apply(self.update_yourself, tuple(map(int, (rstr, gstr, bstr))))
else:
# it was hex and is now decimal
red = string.atoi(rstr, 16)
green = string.atoi(gstr, 16)
blue = string.atoi(bstr, 16)
self.update_yourself(red, green, blue)
red, green, blue = self.__sb.current_rgb()
self.update_yourself(red, green, blue)
def __normalize(self, event=None):
ew = event.widget
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment