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()
示例#2
0
def get_outline_gradient_colors() -> list:
    return colors.str_to_RGBA(command.send('ToolGetOutlineGradientColors?'))
示例#3
0
def get_pixel(x: int, y: int):
    return colors.str_to_RGBA(command.send("GetPixel?", X=x, Y=y))
示例#4
0
def get_back_gradient_colors() -> list:
    return colors.str_to_RGBA(command.send('ToolGetBackGradientColors?'))
示例#5
0
def get_fore_gradient_colors() -> list:
    return colors.str_to_RGBA(command.send('ToolGetForeGradientColors?'))
示例#6
0
def get_outline_color():
    return colors.str_to_RGBA(command.send("ToolGetOutlineColor?"))
示例#7
0
def get_back_color():
    return colors.str_to_RGBA(command.send("ToolGetBackColor?"))
示例#8
0
def get_fore_color():
    return colors.str_to_RGBA(command.send("ToolGetForeColor?"))