Beispiel #1
0
 def get(self, directive_or_id: Union[int,
                                      str]) -> Optional[ColorCollection]:
     final = directive_or_id
     if isinstance(final, str):
         final = get_id(_get_dir(final, "color"))
     return search.get(self, id=final)
Beispiel #2
0
 def set_id(self, directive: str) -> ColorChannel:
     """Set ColorID of ``self`` according to the directive, e.g. ``BG`` or ``color:bg``."""
     self.edit(id=get_id(_get_dir(directive, "color")))
     return self
Beispiel #3
0
 def set_z_layer(self, directive: str) -> Object:
     """Set ``z_layer`` of ``self`` according to the directive, e.g. ``layer:t1`` or ``b3``."""
     self.edit(z_layer=get_id(_get_dir(directive, "layer"), ret_enum=True))
     return self
Beispiel #4
0
 def set_easing(self, directive: str) -> Object:
     """Set ``easing`` of ``self`` according to the directive, e.g. ``sine_in_out``."""
     self.edit(easing=get_id(_get_dir(directive, "easing"), ret_enum=True))
     return self
Beispiel #5
0
 def set_id(self, directive: str) -> Object:
     """Set ``id`` of ``self`` according to the directive, e.g. ``trigger:move``."""
     self.edit(id=get_id(directive))
     return self