chosen_radius = 10 chosen_offset = layer.get_registry("shadow-offset") if chosen_offset == None or len(chosen_offset) != 2: chosen_offset = image.get_registry("shadow-offset") if chosen_offset == None or len(chosen_offset) != 2: chosen_offset = (10, 10) shadow_layer_id = layer.get_registry("shadow-layer-id") if image.get_layer_index(shadow_layer_id) == None: shadow_layer_id = None if shadow_layer_id is not None: layer.select_id(shadow_layer_id) chosen_opacity = layer.get_opacity() overlay_color = colors.str_to_RGBA(layer.get_registry("overlay-color")) layer.select_id(source_layer_id) else: chosen_opacity = layer.get_opacity() * 2 / 3 overlay_color = None if overlay_color is None: overlay_color = colors.BLACK def create_shadow_layer(): global shadow_layer_id image.do_begin() if shadow_layer_id != None: layer.select_id(shadow_layer_id) layer.remove()
def get_outline_gradient_colors() -> list: return colors.str_to_RGBA(command.send('ToolGetOutlineGradientColors?'))
def get_pixel(x: int, y: int): return colors.str_to_RGBA(command.send("GetPixel?", X=x, Y=y))
def get_back_gradient_colors() -> list: return colors.str_to_RGBA(command.send('ToolGetBackGradientColors?'))
def get_fore_gradient_colors() -> list: return colors.str_to_RGBA(command.send('ToolGetForeGradientColors?'))
def get_outline_color(): return colors.str_to_RGBA(command.send("ToolGetOutlineColor?"))
def get_back_color(): return colors.str_to_RGBA(command.send("ToolGetBackColor?"))
def get_fore_color(): return colors.str_to_RGBA(command.send("ToolGetForeColor?"))