---------

Co-authored-by: cajun <12363371+CajunAvenger@users.noreply.github.com>
This commit is contained in:
cajun
2024-10-01 08:34:46 -05:00
committed by GitHub
parent d1b3bdac74
commit 5016c6efa2
32836 changed files with 65408 additions and 48862 deletions

View File

@@ -1,6 +1,6 @@
mse version: 2.0.0
full name: Magic The Gathering, card blend utilities
version: 2015-05-23
version: 2024-10-01
# This file doesn't do anything, other files in this directory can be included
# in game/style files:

View File

@@ -1,11 +1,12 @@
id_mask :=[
32: "/magic-identity-new.mse-include/imask_32.png"
33: "/magic-identity-new.mse-include/imask_33.png"
42: "/magic-identity-new.mse-include/imask_42.png"
43: "/magic-identity-new.mse-include/imask_43.png"
44: "/magic-identity-new.mse-include/imask_44.png"
52: "/magic-identity-new.mse-include/imask_52.png"
53: "/magic-identity-new.mse-include/imask_53.png"
54: "/magic-identity-new.mse-include/imask_54.png"
55: "/magic-identity-new.mse-include/imask_55.png"
ident_include := "/magic-modules.mse-include/indicators"
id_mask := [
32: ident_include + "/imask_32.png"
33: ident_include + "/imask_33.png"
42: ident_include + "/imask_42.png"
43: ident_include + "/imask_43.png"
44: ident_include + "/imask_44.png"
52: ident_include + "/imask_52.png"
53: ident_include + "/imask_53.png"
54: ident_include + "/imask_54.png"
55: ident_include + "/imask_55.png"
]

View File

@@ -9,18 +9,18 @@
########################################################################
include file: masks
mask_hybrid_with_land := { false }
mask_hybrid_with_gold := { false }
mask_multi_land_with_color := { false }
template := { input + "{type}.jpg" }
land_template := { ( if input == "a" then "c" else input)+ "l{type}.jpg" }
offset := 0
mask_hybrid_with_land := { false }
mask_hybrid_with_gold := { false }
mask_multi_land_with_color := { false }
template := { input + "{type}.jpg" }
land_template := { ( if input == "a" then "c" else input) + "l{type}.jpg" }
offset := 0
# For what value should thumbnails of hybrids be made?
hybrid_previews := "hybrid"
hybrid_previews := "hybrid"
# Are there templates for colored lands, land_template(...)?
colored_lands := true
trim_colors :=
colored_lands := true
trim_colors :=
replace@(match:"(, )?(multicolor|hybrid|artifact|land|horizontal|vertical|radial)", replace:"")
watermark_colors := {
@@ -41,27 +41,27 @@ hybrid_color := {
check_colors := card.card_color
if face != "" then check_colors := face
trimmed := trim_colors(check_colors)
if trimmed == "white, blue" then "wu"
else if trimmed == "white, black" then "wb"
else if trimmed == "white, red" then "rw"
else if trimmed == "white, green" then "gw"
else if trimmed == "blue, black" then "ub"
else if trimmed == "blue, red" then "ur"
else if trimmed == "blue, green" then "gu"
else if trimmed == "black, red" then "br"
else if trimmed == "black, green" then "bg"
else if trimmed == "red, green" then "rg"
else if trimmed == "white, blue, reversed" then "uw"
else if trimmed == "white, black, reversed" then "bw"
else if trimmed == "white, red, reversed" then "wr"
else if trimmed == "white, green, reversed" then "wg"
else if trimmed == "blue, black, reversed" then "bu"
else if trimmed == "blue, red, reversed" then "ru"
else if trimmed == "blue, green, reversed" then "ug"
else if trimmed == "black, red, reversed" then "rb"
else if trimmed == "black, green, reversed" then "bg"
else if trimmed == "red, green, reversed" then "gr"
else "mm"
if trimmed == "white, blue" then "wu"
else if trimmed == "white, black" then "wb"
else if trimmed == "white, red" then "rw"
else if trimmed == "white, green" then "gw"
else if trimmed == "blue, black" then "ub"
else if trimmed == "blue, red" then "ur"
else if trimmed == "blue, green" then "gu"
else if trimmed == "black, red" then "br"
else if trimmed == "black, green" then "bg"
else if trimmed == "red, green" then "rg"
else if trimmed == "white, blue, reversed" then "uw"
else if trimmed == "white, black, reversed" then "bw"
else if trimmed == "white, red, reversed" then "wr"
else if trimmed == "white, green, reversed" then "wg"
else if trimmed == "blue, black, reversed" then "bu"
else if trimmed == "blue, red, reversed" then "ru"
else if trimmed == "blue, green, reversed" then "ug"
else if trimmed == "black, red, reversed" then "rb"
else if trimmed == "black, green, reversed" then "bg"
else if trimmed == "red, green, reversed" then "gr"
else "mm"
}@(face:"")
########################################################################
# Combining multiple colors (hybrids)
@@ -78,8 +78,8 @@ card_hybrid_2 := {linear_blend(
overlay_hybrid := [
1: { template( colors[0] ) }
2: {combine_blend(
image1: template( colors[0] ),
image2: template( colors[1] ),
image1: template( colors[0] ),
image2: template( colors[1] ),
combine: "symmetric overlay"
)}
]
@@ -87,7 +87,7 @@ overlay_hybrid := [
# vertical version of a horizontal hybrid
vertical_card_hybrid := {
do_linear_blend := linear_blend
do_linear_blend := linear_blend
linear_blend := { do_linear_blend(x1: 0, x2: 0, y1: x1, y2: x2) }
card_hybrid.horizontal[color_count]()
}
@@ -102,7 +102,7 @@ horizontal_card_hybrid := [
x2: 0.4, y2: 0
image2: linear_blend(
image1: template( colors[(to_int(offset) + 1 ) mod 3] ),
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
x1: 0.6, y1: 0
x2: 0.78, y2: 0
)
@@ -124,15 +124,15 @@ horizontal_card_hybrid := [
)))}
5: {linear_blend(
image1: template( colors[(to_int(offset) + 0 ) mod 5] ),
image1: template( colors[(to_int(offset) + 0 ) mod 5] ),
x1: 2.0 / 15, y1: 0
x2: 4.0 / 15, y2: 0
image2: linear_blend(
image1: template( colors[(to_int(offset) + 1 ) mod 5] ),
image1: template( colors[(to_int(offset) + 1 ) mod 5] ),
x1: 5.0 / 15, y1: 0
x2: 7.0 / 15, y2: 0
image2: linear_blend(
image1: template( colors[(to_int(offset) + 2 ) mod 5] ),
image1: template( colors[(to_int(offset) + 2 ) mod 5] ),
x1: 8.0 / 15, y1: 0
x2: 10.0 / 15, y2: 0
image2: linear_blend(
@@ -198,19 +198,19 @@ card_hybrid := [
radial: [
0: { template( "c") }
1: { template( colors[0]) }
2: card_hybrid_2
2: card_hybrid_2
3:{linear_blend(
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 3] +
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 3] +
colors[(to_int(offset) + 1 ) mod 3] ),
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
image2: template( colors[(to_int(offset) + 2 ) mod 3] ),
x1: 0, y1: 0.55
x2: 0, y2: 0.77
)}
4:{linear_blend(
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 4] +
colors[(to_int(offset) + 1 ) mod 4] ),
image2: card_hybrid_2( colors: colors[(to_int(offset) + 3 ) mod 4] +
image2: card_hybrid_2( colors: colors[(to_int(offset) + 3 ) mod 4] +
colors[(to_int(offset) + 2 ) mod 4] ),
x1: 0, y1: 0.4
x2: 0, y2: 0.62
@@ -219,7 +219,7 @@ card_hybrid := [
5: {linear_blend(
image1: linear_blend(
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 5] +
colors[(to_int(offset) + 1 ) mod 5] ),
colors[(to_int(offset) + 1 ) mod 5] ),
image2: card_hybrid_2( colors: colors[(to_int(offset) + 4 ) mod 5] +
colors[(to_int(offset) + 2 ) mod 5] ),
x1: 0, y1: 0.19
@@ -235,7 +235,7 @@ card_hybrid := [
image1: card_hybrid_2( colors: colors[(to_int(offset) + 0 ) mod 6] +
colors[(to_int(offset) + 1 ) mod 6] ),
image2: card_hybrid_2( colors: colors[(to_int(offset) + 5 ) mod 6] +
colors[(to_int(offset) + 2 ) mod 6] ),
colors[(to_int(offset) + 2 ) mod 6] ),
x1: 0, y1: 0.19
x2: 0, y2: 0.35
),
@@ -267,7 +267,7 @@ card_hybrid := [
]
horizontal: horizontal_card_hybrid
vertical: [
1: { template( colors[0]) }
1: { template( colors[0]) }
2: { linear_blend(
image1: template( colors[0] ),
image2: template( colors[1] ),
@@ -350,7 +350,7 @@ pt_hybrid := [
x1: 0, y1: -1.5
x2: 0, y2: 0.7
)}
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
]
horizontal: horizontal_pt_hybrid
vertical: [
@@ -799,7 +799,7 @@ stamp_hybrid := [
image2: template( colors[(to_int(offset) + 3) mod 6] ),
x1: -0.3, y1: 0
x2: 1.3, y2: 0
)}
)}
7: { template( colors[(to_int(offset) + 4 ) mod 7]) }
]
horizontal: horizontal_stamp_hybrid
@@ -817,7 +817,23 @@ stamp_hybrid := [
########################################################################
# Putting it all together.
########################################################################
blend_colors := {
colors := sort_text( order: if card_is_wedge(input) then "(wbgur)" else "(wubrg)"
, (if chosen(choice:"white" ) then "w")
+ (if chosen(choice:"blue" ) then "u")
+ (if chosen(choice:"black" ) then "b")
+ (if chosen(choice:"red" ) then "r")
+ (if chosen(choice:"green" ) then "g"))
if multi and (hybrid or colors == "") then (
colors := colors + "m"
)
if artifact and (hybrid or colors == "") then (
colors := colors + "a"
)
if chosen(choice:"reversed") then colors := reverse(colors)
if colors == "" then colors := "c"
colors
}
# Determine the card background based on the card_color multiple choice options
color_background := {
@@ -839,112 +855,102 @@ color_background := {
if land and colored_lands then template := land_template # use land template instead?
# The selected colors
colors := sort_text( order: if card_is_wedge(input) then "(wbgur)" else "(wubrg)"
, (if chosen(choice:"white" ) then "w")
+ (if chosen(choice:"blue" ) then "u")
+ (if chosen(choice:"black" ) then "b")
+ (if chosen(choice:"red" ) then "r")
+ (if chosen(choice:"green" ) then "g"))
if multi and (hybrid or colors == "") then (
colors := colors + "m"
multi := false
)
if artifact and (hybrid or colors == "") then (
colors := colors + "a"
artifact := false
)
if chosen(choice:"reversed") then colors := reverse(colors)
color_count := number_of_items(in: colors)
if colors == "" then colors == "c"
colors := blend_colors(input,land:land, multi:multi, hybrid:hybrid, artifact:artifact)
if contains(colors, match:"a") then artifact := false
if contains(colors, match:"m") then multi := false
color_count := if colors == "c" then 0 else number_of_items(in: colors)
# 'shape' / type of hybrid
shape := if chosen(choice:"horizontal" ) then "horizontal"
else if chosen(choice:"vertical" ) then "vertical"
else if chosen(choice:"overlay" ) then "overlay"
else "radial"
shape := if chosen(choice:"horizontal" ) then "horizontal"
else if chosen(choice:"vertical" ) then "vertical"
else if chosen(choice:"overlay" ) then "overlay"
else "radial"
# Determine background (allows styles to hook something else here)
color_combination(folder:folder)
}@(folder: "")
color_combination(folder:folder, blend_type:blend_type)
}@(folder: "", blend_type:"")
color_combination := {
# does this have an override blend_type?
if blend_type == "" then blend_type := type
# The base hybrid, without the outer frame blended over it
base := base_hybrid[shape][color_count]()
# Put a frame around it?
if land and not colored_lands then
masked_blend(
mask: "{folder}multicolor_blend_{type}.png",
mask: "{folder}multicolor_blend_{blend_type}.png",
dark: land_template("c"),
light: base,
)
else if land and multi and mask_multi_land_with_color() then
masked_blend(
mask: "{folder}hybrid_blend_{type}.png",
mask: "{folder}hybrid_blend_{blend_type}.png",
dark: base,
light: land_template("m"),
)
else if multi and artifact then
masked_blend(
mask: "{folder}artifact_blend_{type}.png",
mask: "{folder}artifact_blend_{blend_type}.png",
dark: template("a"),
light: masked_blend(
mask: "{folder}multicolor_blend_{type}.png",
mask: "{folder}multicolor_blend_{blend_type}.png",
dark: template("m"),
light: base
)
)
else if multi then
masked_blend(
mask: "{folder}multicolor_blend_{type}.png",
mask: "{folder}multicolor_blend_{blend_type}.png",
dark: template("m"),
light: base,
)
else if artifact and color_count > 1 and mask_hybrid_with_land() then
masked_blend(
mask: "{folder}artifact_blend_{type}.png",
mask: "{folder}artifact_blend_{blend_type}.png",
dark: template("a"),
light: masked_blend(
mask: "{folder}multicolor_blend_{type}.png",
mask: "{folder}multicolor_blend_{blend_type}.png",
dark: template("c"),
light: base
)
)
else if artifact and color_count > 1 and mask_hybrid_with_gold() then
masked_blend(
mask: "{folder}artifact_blend_{type}.png",
mask: "{folder}artifact_blend_{blend_type}.png",
dark: template("a"),
light: masked_blend(
mask: "{folder}multicolor_blend_{type}.png",
mask: "{folder}multicolor_blend_{blend_type}.png",
dark: template("m"),
light: base
)
)
else if artifact then
masked_blend(
mask: "{folder}artifact_blend_{type}.png",
mask: "{folder}artifact_blend_{blend_type}.png",
dark: template("a"),
light: base,
)
else if color_count > 1 and mask_hybrid_with_land() then
masked_blend(
mask: "{folder}hybrid_blend_{type}.png",
mask: "{folder}hybrid_blend_{blend_type}.png",
dark: land_template("c"),
light: base,
)
else if color_count > 1 and mask_hybrid_with_gold() then
masked_blend(
mask: "{folder}hybrid_blend_{type}.png",
mask: "{folder}hybrid_blend_{blend_type}.png",
dark: land_template("m"),
light: base,
)
else base
}@(folder: "")
}@(folder: "", blend_type:"")
########################################################################
# Specific types
########################################################################
card_background := { color_background(type:"card", base_hybrid:card_hybrid) }@(offset:0 )
card_background2 := { color_background(type:"card2", base_hybrid:card_hybrid) }@(offset:0 )
card_ptbox := { color_background(type:"pt", base_hybrid:pt_hybrid) }@(offset:0 )
flip_ptbox := { color_background(type:"pt", base_hybrid:flip_pt_hybrid) }@(offset:0 )
flip_ptbox2 := { color_background(type:"pt2", base_hybrid:flip_pt_hybrid2) }@(offset:0 )
@@ -958,6 +964,49 @@ card_identity_2 := { color_background(type:"identity2", base_hybrid:identity_hy
card_stamp := { color_background(type:"stamp", base_hybrid:stamp_hybrid) }@(offset:0 )
card_stamp2 := { color_background(type:"stamp2", base_hybrid:stamp_hybrid) }@(offset:0 )
template_prefix := []
module_card := { color_background(type:"card", base_hybrid:card_hybrid, folder:template_prefix["card"]) }
module_card2 := { color_background(type:"card2", base_hybrid:card_hybrid, folder:template_prefix["card2"]) }
module_identity := { color_background(type:"identity", base_hybrid:identity_hybrid, folder:template_prefix["identity"]) }
module_stamp := { color_background(type:"stamp", base_hybrid:stamp_hybrid, folder:template_prefix["stamp"]) }
module_ubstamp := { color_background(type:"ubstamp", base_hybrid:stamp_hybrid, folder:template_prefix["ubstamp"], blend_type:"stamp") }
module_nyx := {
type := "nyx"
if has_png(set.alternate_nyx) and type_name(harder_script["alt_nyx" or else nil] or else nil) != type_name(nil)
then type := "alt_nyx"
else if set.alternate_nyx == "star" and type_name(harder_script["star" or else nil] or else template_prefix["star" or else nil] or else nil) != type_name(nil)
then type := "star"
color_background(
type: type,
blend_type: "nyx",
base_hybrid:card_hybrid,
folder:template_prefix["nyx"],
)
}
module_snow := { color_background(type:"snow", base_hybrid:card_hybrid, folder:template_prefix["snow"]) }
module_alias := { color_background(type:"alias", base_hybrid:card_hybrid, folder:template_prefix["alias"]) }
module_ptbox := {
if vehicle then template_prefix["pt"] + "vpt.png"
else color_background(type:"pt", base_hybrid:pt_hybrid, folder:template_prefix["pt"])
}@(vehicle:false)
module_ptbox2 := {
if vehicle then template_prefix["pt"] + "vpt.png"
else color_background(type:"pt2", base_hybrid:pt_hybrid, folder:template_prefix["pt"], blend_type:"pt")
}@(vehicle:false)
module_levelpt := {
if vehicle then template_prefix["pt"] + "vpt.png"
else color_background(type:"pt", base_hybrid:leveler_pt_hybrid, folder:template_prefix["pt"])
}@(vehicle:false)
module_levelpt2 := {
if vehicle then template_prefix["pt"] + "vpt.png"
else color_background(type:"pt", base_hybrid:leveler_pt_hybrid2, folder:template_prefix["pt"])
}@(vehicle:false)
module_levelpt3 := {
if vehicle then template_prefix["pt"] + "vpt.png"
else color_background(type:"pt", base_hybrid:leveler_pt_hybrid3, folder:template_prefix["pt"])
}@(vehicle:false)
flip_background := {
linear_blend(
image1: card_background(top)
@@ -983,36 +1032,38 @@ font_color_positions := [
# Determine whether light or dark fonts should be used
font_white := {
hybrid := chosen(choice:"hybrid" )
artifact := chosen(choice:"artifact" )
colors := sort_text( order: "(wubrg)"
, (if chosen(choice:"white" ) then "w")
+ (if chosen(choice:"blue" ) then "u")
+ (if chosen(choice:"black" ) then "b")
+ (if chosen(choice:"red" ) then "r")
+ (if chosen(choice:"green" ) then "g"))
+ (if artifact then "a")
hybrid := chosen(choice:"hybrid" )
artifact := chosen(choice:"artifact" )
colors := sort_text( order: "(wubrg)"
, (if chosen(choice:"white" ) then "w")
+ (if chosen(choice:"blue" ) then "u")
+ (if chosen(choice:"black" ) then "b")
+ (if chosen(choice:"red" ) then "r")
+ (if chosen(choice:"green" ) then "g"))
+ (if artifact then "a")
font_colors_white(
if chosen(choice:"land") then "l"
else if input == "artifact, multicolor" then "a"
else if chosen(choice:"multicolor") then "m"
else if artifact and not hybrid then "a"
else if colors == "" then "c"
else colors[
else if input == "artifact, multicolor" then "a"
else if chosen(choice:"multicolor") then "m"
else if artifact and not hybrid then "a"
else if colors == "" then "c"
else colors[
font_color_positions[
if chosen(choice:"horizontal") then "horizontal"
else if chosen(choice:"vertical") then "vertical"
else if chosen(choice:"overlay") then "overlay"
else "radial"
][number_of_items(in: colors)]
]
if chosen(choice:"horizontal") then "horizontal"
else if chosen(choice:"vertical") then "vertical"
else if chosen(choice:"overlay") then "overlay"
else "radial"
][number_of_items(in: colors)]
]
)
}
font_color := { if font_white() then rgb(255,255,255) else rgb(0,0,0) }
#####Watermark Blending
watermark_hybrid:= {
#### Overwrite this in style files until we fully deprecate this
watermark_include := "/magic-watermarks.mse-include"
watermark_hybrid := {
linear_blend(
image1: colors[0] + input + ".png"
image2: colors[1] + input + ".png"
@@ -1027,15 +1078,15 @@ set_watermark_blend := {
linear_blend(
image1:
masked_blend(
light: "/magic-watermarks.mse-include/sets/" + input + ".png"
dark: "/magic-watermarks.mse-include/sets/" + watermark_colors().0 + "mark.png"
mask: "/magic-watermarks.mse-include/sets/" + input + ".png"
light: watermark_include + "/sets/" + input + ".png"
dark: watermark_include + "/sets/" + watermark_colors().0 + "mark.png"
mask: watermark_include + "/sets/" + input + ".png"
)
image2:
masked_blend(
light: "/magic-watermarks.mse-include/sets/" + input + ".png"
dark: "/magic-watermarks.mse-include/sets/" + watermark_colors().1 + "mark.png"
mask: "/magic-watermarks.mse-include/sets/" + input + ".png"
light: watermark_include + "/sets/" + input + ".png"
dark: watermark_include + "/sets/" + watermark_colors().1 + "mark.png"
mask: watermark_include + "/sets/" + input + ".png"
)
x1: 0.4, y1: 0
x2: 0.6, y2: 0
@@ -1043,38 +1094,125 @@ set_watermark_blend := {
)
}
spotlight_watermark_blend := {
if face == false then face := card.card_color
wmc := watermark_colors(face:face)
c1 := "/magic-watermarks.mse-include/spotlight/" + wmc.0 + (if contains(face, match:"land") then "l") + "spotlight.png"
c2 := "/magic-watermarks.mse-include/spotlight/" + wmc.1 + (if contains(face, match:"land") then "l") + "spotlight.png"
if contains(input, match:".png,") then (
array := split_text(input+",,", match:",")
face := [1:card.card_color, 2:card.card_color_2, 3:card.card_color_3][face]
if type_of(input) == type_of("string") then (
array := split_comma(input)
input := array.0
l := min(to_number(array.1),500)
h := min(to_number(array.2),500)
)
if (h != 500 or l != 500) then (
c1 := crop(c1, height:h, width:l, offset_x:0, offset_y:0)
c2 := crop(c2, height:h, width:l, offset_x:0, offset_y:0)
)
set_alpha(
alpha: 0.75
input:
linear_blend(
image1:
masked_blend(
light: input
dark: c1
mask: input
)
image2:
masked_blend(
light: input
dark: c2
mask: input
)
x1: 0.4, y1: 0
x2: 0.6, y2: 0
if length(array) > 1 then (
px := px_split(array.2)
if length(px) > 2
then l := 0
else (
l := px.0
h := px.1
)
)
)
}@(h:500,l:500,face:false)
if l < 1 or h < 1 or l > 1024 or h > 1024 then (
input
) else (
wmc := watermark_colors(face:face)
c1 := wmc.0 + (if contains(face, match:"land") then "l") + "spotlight.png"
c2 := wmc.1 + (if contains(face, match:"land") then "l") + "spotlight.png"
wmdir := watermark_include + "/spotlight/"
c1 := crop(wmdir+c1, height:h, width:l, offset_x:0, offset_y:0)
c2 := crop(wmdir+c2, height:h, width:l, offset_x:0, offset_y:0)
mask := input
set_alpha(
alpha: alpha
input:
linear_blend(
image1:
masked_blend(
light: input
dark: c1
mask: mask
)
image2:
masked_blend(
light: input
dark: c2
mask: mask
)
x1: 0.4, y1: 0
x2: 0.6, y2: 0
)
)
)
}@(face:1,alpha:0.2,l:500,h:500)
shadow_watermark_blend := {
set_combine(
combine:"shadow",
set_alpha(
alpha: alpha,
drop_shadow(
offset_x: -0.01,
offset_y: 0.03,
blur_radius: 0.02,
alpha: 1,
color: rgb(0,0,0),
enlarge(
border_size: 0.03,
invert_image(input)
)
)
)
)
}@(alpha:0.5)
glow_watermark_blend := {
set_combine(
combine:"glow",
set_alpha(
alpha: alpha,
drop_shadow(
offset_x: -0.01,
offset_y: 0.03,
blur_radius: 0.02,
alpha: 1,
color: rgb(0,0,0),
enlarge(
border_size: 0.03,
invert_image(input)
)
)
)
)
}@(alpha:0.3)
watermark_blend :=
{
shadow_alpha := 0.5
glow_alpha := 0.3
backup := if custom then set.blend_with_colors else set.use_blended_watermarks
option := styling.watermark_render or else backup
dark_textbox := (face == 1 and invert_watermark_1())
or (face == 2 and invert_watermark_2())
or (face == 3 and invert_watermark_3())
if option == "inverted" then dark_textbox := not dark_textbox
invert_base_image := false
if dark_textbox then
(
alpha := dark_alpha
spotlight_alpha := dark_spotlight_alpha
invert_base_image := true
)
user_alpha := styling.watermark_opacity_percentage or else ""
user_alpha := if user_alpha != "" then get_alpha_percentage(user_alpha, default: -1.0) else -1.0
if user_alpha >= 0.0 then
(
alpha := user_alpha
spotlight_alpha := user_alpha
shadow_alpha := user_alpha
glow_alpha := user_alpha
)
if colored then set_alpha(alpha: alpha, input)
else if option == "yes" or option == "blend with colors" then spotlight_watermark_blend(h:h, l:l, face:face, alpha: spotlight_alpha, input)
else if option == "shadow" then shadow_watermark_blend(input, alpha: shadow_alpha)
else if option == "glow" then glow_watermark_blend(input, alpha: glow_alpha)
else if invert_base_image then set_alpha(alpha: alpha, invert_image(input))
else set_alpha(alpha: alpha, input)
}@(h:500,l:500,colored:false,face:1,alpha:0.25,spotlight_alpha:0.75,dark_alpha:0.25,dark_spotlight_alpha:0.35,custom:false)