2 from .base import Widget
5 class Marquise(Widget):
8 def __init__(self, cover, edge_top):
9 self.edge_top = edge_top
10 super().__init__(cover)
13 self.slope_w = self.cover.m.width / self.segments / 2
14 self.segment_h = self.cover.m.margin
15 self.title_box_position = (
17 self.cover.m.title_box_top
20 def get_points(self, w):
21 tip_y = self.edge_top + self.segment_h
27 for i in range(self.segments - 1, 0, -1):
29 ((2 * i + 1) * self.slope_w, self.edge_top),
30 (2 * i * self.slope_w, tip_y)
33 (self.slope_w, self.edge_top),
38 def build(self, w, h):
39 img = PIL.Image.new('RGBA', (
40 round(w), round(self.edge_top + self.segment_h)
42 draw = PIL.ImageDraw.ImageDraw(img)
44 self.get_points(w), fill=self.cover.color_scheme['rgb'])