summaryrefslogtreecommitdiff
path: root/prepare
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2023-12-06 17:24:48 -0600
committerZach van Rijn <me@zv.io>2023-12-06 17:24:48 -0600
commit9b1d264510eb2339cf727cbb74c7864c7c2c996b (patch)
tree074445cc420ef91784d3d2599995c78e4b352536 /prepare
parent45f0edd74658f39e7ed1e61e5159f7fdb58a497d (diff)
downloadwallpapers-current.tar.gz
wallpapers-current.tar.bz2
wallpapers-current.tar.xz
wallpapers-current.zip
Adjust gradient colors. Clarify wallpaper generation.HEAD1.1current
Diffstat (limited to 'prepare')
-rwxr-xr-xprepare56
1 files changed, 45 insertions, 11 deletions
diff --git a/prepare b/prepare
index 4cf6843..f6b29d0 100755
--- a/prepare
+++ b/prepare
@@ -114,6 +114,12 @@ EOF
);
+##
+# Y-axis menu bar offset (maximum).
+#
+MENU=100;
+
+
#---------------------------------------------------------------
# internal: meta
#---------------------------------------------------------------
@@ -249,7 +255,9 @@ size_only ()
#---------------------------------------------------------------
mkdir -p "${HERE}/${TEMP}";
-mkdir -p "${HERE}/${KEEP}";
+
+rm -fr "${HERE}"/${KEEP};
+mkdir "${HERE}/${KEEP}";
##
# Fetch the specified brand asset bundle from distfiles.
@@ -275,6 +283,15 @@ mkdir -p "${HERE}/${KEEP}";
# The default "core" or "slim" wallpaper is made on the fly and
# not provided as a rasterized image from the start.
#
+# Discrete conversion steps are used for clarity of intent, even
+# though the same effect can be achieved by combining steps.
+#
+# FIXME: the 'MENU' padding needs to be 100px after resizing; we
+# currently do it before resizing. So we have to do a "reverse"
+# calculation to determine what is the equivalent of 100px for
+# the shortest target size for each aspect ratio. 100px is also
+# just an estimate and is not based on actual facts.
+#
##
# make_fake GRADIENT_FROM GRADIENT_TO XxY TEMPLATE OUTPUT [ARGS]
@@ -289,6 +306,8 @@ make_fake ()
args="${@}"; # all remaining arguments
printf "Generating %5s ('%s')...\n" "${size}" "${name}";
+
+ # generate gradient brackground of correct size
gm convert \
-define gradient:direction=NorthEast \
-size ${size} \
@@ -296,26 +315,40 @@ make_fake ()
"${name}" \
;
- # FIXME: this is literal magic?
+ # polyguin scaled to 80% of Y-MENU, translated +MENU
+ gm convert \
+ -background none \
+ -resize ${size%x*}x$(((${size#*x}-${MENU})*80/100)) \
+ "${TEMP}"/polyguin.svg \
+ "${name}.tmp.png" \
+ ;
gm composite \
-compose atop \
-gravity southwest \
- -background none \
- -resize ${size%x*}x$((${size#*x}*80/100)) \
- "${TEMP}"/polyguin.svg \
- -geometry +0+100 \
+ "${name}.tmp.png" \
+ -geometry +0+${MENU} \
"${name}" \
"${name}" \
;
+
+ # polylogo scaled to 10% of Y-MENU, translated +MENU
+ gm convert \
+ -background none \
+ -resize ${size%x*}x$(((${size#*x}-${MENU})*10/100)) \
+ "${TEMP}"/gen_polylogo_template_${temp}.png \
+ "${name}.tmp.png" \
+ ;
gm composite \
-compose atop \
-gravity southeast \
- -background none \
- "${TEMP}"/gen_polylogo_template_${temp}.png \
- -geometry +50+100 \
+ "${name}.tmp.png" \
+ -geometry +50+${MENU} \
"${name}" \
"${name}" \
;
+ rm "${name}.tmp.png";
+
+ # apply any custom transformations
gm convert \
${args} \
"${name}" \
@@ -336,7 +369,7 @@ printf "%s\n" "${MAKE}" | while read ratio scale _; do
# background (monochrome)
mkdir -p "${TEMP}"/generated/background;
make_fake ${x}x${y} \
- "#bbbbbb" "#eeeeee" \
+ "#777777" "#dddddd" \
black_x200 \
"${TEMP}"/generated/background/${x}x${y}.png \
-colorspace Gray \
@@ -345,7 +378,7 @@ printf "%s\n" "${MAKE}" | while read ratio scale _; do
# lockscreen (full color)
mkdir -p "${TEMP}"/generated/lockscreen;
make_fake ${x}x${y} \
- "#151515" "#303030" \
+ "#111111" "#444444" \
white_x200 \
"${TEMP}"/generated/lockscreen/${x}x${y}.png \
;
@@ -498,6 +531,7 @@ EOF
# output: create tarball
#---------------------------------------------------------------
+rm -fr adelie-wallpapers-${VTAG};
mkdir -p adelie-wallpapers-${VTAG}/usr/share;
# wallpapers