def _layer_changed(self):
    if (self._sync_color is not None):
        self._sync_color.stop_syncing()
    if (self._sync_alpha is not None):
        self._sync_alpha.stop_syncing()
    if (self.layer is not None):
        self.color = self.layer.style.color
        self.alpha = self.layer.style.alpha
        self._sync_color = keep_in_sync(self, 'color', self.layer.style, 'color')
        self._sync_alpha = keep_in_sync(self, 'alpha', self.layer.style, 'alpha')
def _layer_changed(self):
    if (self._sync_color is not None):
        self._sync_color.stop_syncing()
    if (self._sync_alpha is not None):
        self._sync_alpha.stop_syncing()
    if (self.layer is not None):
        self.color = self.layer.style.color
        self.alpha = self.layer.style.alpha
        self._sync_color = keep_in_sync(self, 'color', self.layer.style, 'color')
        self._sync_alpha = keep_in_sync(self, 'alpha', self.layer.style, 'alpha')