diff options
Diffstat (limited to 'sugar/graphics/iconcolor.py')
-rw-r--r-- | sugar/graphics/iconcolor.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/sugar/graphics/iconcolor.py b/sugar/graphics/iconcolor.py index d736d54..71dfe18 100644 --- a/sugar/graphics/iconcolor.py +++ b/sugar/graphics/iconcolor.py @@ -20,32 +20,32 @@ import random from sugar.graphics.colors import colors def _parse_string(color_string): - if color_string == 'white': - return ['#ffffff', '#414141'] + if color_string == 'white': + return ['#ffffff', '#414141'] - splitted = color_string.split(',') - if len(splitted) == 2: - return [splitted[0], splitted[1]] - else: - return None + splitted = color_string.split(',') + if len(splitted) == 2: + return [splitted[0], splitted[1]] + else: + return None def is_valid(color_string): - return (_parse_string(color_string) != None) + return (_parse_string(color_string) != None) class IconColor: - def __init__(self, color_string=None): - if color_string == None or not is_valid(color_string): - n = int(random.random() * (len(colors) - 1)) - [self._stroke, self._fill] = colors[n] - else: - [self._stroke, self._fill] = _parse_string(color_string) + def __init__(self, color_string=None): + if color_string == None or not is_valid(color_string): + n = int(random.random() * (len(colors) - 1)) + [self._stroke, self._fill] = colors[n] + else: + [self._stroke, self._fill] = _parse_string(color_string) - def get_stroke_color(self): - return self._stroke + def get_stroke_color(self): + return self._stroke - def get_fill_color(self): - return self._fill + def get_fill_color(self): + return self._fill - def to_string(self): - return '%s,%s' % (self._stroke, self._fill) + def to_string(self): + return '%s,%s' % (self._stroke, self._fill) |