def __init__(self, type=LINEAR, x=0, y=0, width=1, height=1, string=None): Serializable.__init__(self) self.type = type self.colors = [ GradientColor(1, 1, 1, 1, 0), GradientColor(0, 0, 0, 1, 1) ] self.x, self.y = x, y self.width, self.height = width, height if type == LINEAR: self.gradient = cairo.LinearGradient(x, y, width, height) elif type == RADIAL: self.gradient = cairo.RadialGradient(x, y, width, height, 10, 100) if string: self.colors = [] data = string.split('|') area = data.pop().split(':') self.x = float(area[0]) self.y = float(area[1]) self.width = float(area[2]) self.height = float(area[3]) map(lambda color: self.colors.append(GradientColor(string=color)), data) self.update()
def __init__(self, red=0.0, green=0.0, blue=0.0, alpha=1.0, string=None): Serializable.__init__(self) self.red = red self.green = green self.blue = blue self.alpha = alpha if string: self.set_color_as_hex(string)
def __init__(self, type=LINEAR, x=0, y=0, width=1, height=1, string=None): Serializable.__init__(self) self.type = type self.colors = [GradientColor(1, 1, 1, 1, 0), GradientColor(0, 0, 0, 1, 1)] self.x, self.y = x, y self.width, self.height = width, height if type == LINEAR: self.gradient = cairo.LinearGradient(x, y, width, height) elif type == RADIAL: self.gradient = cairo.RadialGradient(x, y, width, height, 10, 100) if string: self.colors = [] data = string.split('|') area = data.pop().split(':') self.x = float(area[0]) self.y = float(area[1]) self.width = float(area[2]) self.height = float(area[3]) map(lambda color: self.colors.append(GradientColor(string=color)), data) self.update()
def __init__(self): Serializable.__init__(self) self.width = 0 self.height = 0
def __init__(self, x = 0, y = 0): Serializable.__init__(self) self.x, self.y = y, y
def __init__(self): Serializable.__init__(self) self.pages = list()