def crop_left(self) -> Optional[Percent]: if self._src_rect is not None: l_str = self._src_rect.get('l') if l_str is not None: return Percent(l_str) if self.do_use_defaults_when_null: return self._default_crop_left return None
def crop_top(self) -> Optional[Percent]: if self._src_rect is not None: t_str = self._src_rect.get('t') if t_str is not None: return Percent(t_str) if self.do_use_defaults_when_null: return self._default_crop_top return None
def crop_bottom(self) -> Optional[Percent]: if self._src_rect is not None: b_str = self._src_rect.get('b') if b_str is not None: return Percent(b_str) if self.do_use_defaults_when_null: return self._default_crop_bottom return None
def crop_right(self) -> Optional[Percent]: if self._src_rect is not None: r_str = self._src_rect.get('r') if r_str is not None: return Percent(r_str) if self.do_use_defaults_when_null: return self._default_crop_right return None
def gradient_stops(self) -> List[GradientStop]: if self._gs_lst is None: return list() result = list() color_maker = self._shape.color_maker for gs in self._gs_lst: percent = Percent(gs.get('pos', 0)) color_xml = next(iter(gs)) color = color_maker.make_color(color_xml) result.append( self.GradientStop(int(percent.percent100), color.rgb_str, color.alpha)) return result
def _default_crop_top(self) -> Percent: return Percent(0)
def crop_left(self, v: int) -> Percent: return Percent(v)
def _default_crop_left(self) -> Percent: return Percent(0)
def crop_bottom(self, v: int) -> Percent: return Percent(v)
def _default_crop_bottom(self) -> Percent: return Percent(0)
def crop_right(self, v: int) -> Percent: return Percent(v)
def _default_crop_right(self) -> Percent: return Percent(0)
def crop_top(self, v: int) -> Percent: return Percent(v)