-
Notifications
You must be signed in to change notification settings - Fork 1
/
combine_images.sh
75 lines (52 loc) · 1.29 KB
/
combine_images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
if [ -z "$IMAGE_DIR" ]; then
IMAGE_DIR=/local/dbicon/ibm/carbon-pictograms-png
fi
if [ -z "$DBICON_DIR" ]; then
DBICON_DIR=/local/dbicon/carbon-icons-64x64
fi
combine_images()
{
local FILE=$(basename "$1")
if [ -e "$TARGET_DIR/${FILE}" ]; then
return 0
fi
convert "$BACKGROUND_DIR/${SHAPE}_${TYPE}/${COLOR}.png" "$1" -gravity center -composite "$TARGET_DIR/${FILE}" &
}
export -f combine_images
make_color ()
{
export COLOR=$1
export COLOR_LOWER=$(echo $1 | awk '{ print tolower($1) }')
export TARGET_DIR=${DBICON_DIR}/${SHAPE}/${TYPE}/${COLOR}/${SYMBOL_COLOR}
mkdir -p "$TARGET_DIR"
find "$IMAGE_DIR/$SYMBOL_COLOR/$PIXEL" -name "*.png" -exec bash -c 'combine_images $0' {} \;
}
make_colors ()
{
make_color "blue"
make_color "yellow"
make_color "orange"
}
export IMAGE_DIR
export DBICON_DIR
export BACKGROUND_DIR=hcl/background
export TYPE=gradient
# Export all icons with white symbols
export SYMBOL_COLOR=white
export SHAPE=square
export PIXEL=56
make_colors
export SHAPE=circle
export PIXEL=40
make_colors
exit 0
# Black isn't a good color for the symbols. But someone might want to experiment
# Export all icons with black symbols
export SYMBOL_COLOR=black
export SHAPE=square
export PIXEL=56
make_colors
export SHAPE=circle
export PIXEL=40
make_colors