Add get_color() function

This commit is contained in:
Dan Williams 2007-02-27 15:02:42 -05:00
parent a8cabac590
commit f5051b7c14

View File

@ -117,19 +117,19 @@ class ColorPicker(hippo.CanvasBox, hippo.CanvasItem):
stroke_color=color.HTMLColor(self._fg_hex), stroke_color=color.HTMLColor(self._fg_hex),
fill_color=color.HTMLColor(self._bg_hex)) fill_color=color.HTMLColor(self._bg_hex))
self._set_random_colors() self._set_random_colors()
self._emit_color()
self._xo.connect('activated', self._xo_activated_cb) self._xo.connect('activated', self._xo_activated_cb)
self.append(self._xo) self.append(self._xo)
def _xo_activated_cb(self, item): def _xo_activated_cb(self, item):
self._set_random_colors() self._set_random_colors()
self._emit_color()
def _emit_color(self):
xo_color = XoColor('%s,%s' % (self._xo.props.stroke_color.get_html(), xo_color = XoColor('%s,%s' % (self._xo.props.stroke_color.get_html(),
self._xo.props.fill_color.get_html())) self._xo.props.fill_color.get_html()))
self.emit('color', xo_color) self.emit('color', xo_color)
def get_color(self):
return XoColor('%s,%s' % (self._xo.props.stroke_color.get_html(),
self._xo.props.fill_color.get_html()))
def _update_xo_hex(self, fg=None, bg=None): def _update_xo_hex(self, fg=None, bg=None):
"""set the colors of the XO man""" """set the colors of the XO man"""
if fg: if fg: