blob: 456d1a40715feca400214558c7157724828a1626 (
plain)
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
|
#!/bin/sh
# Generate dupre-palette.png from color definitions using ImageMagick.
# Output: assets/color-themes/dupre/dupre-palette.png
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
OUTPUT="$SCRIPT_DIR/dupre/dupre-palette.png"
SWATCH_W=140
SWATCH_H=80
LABEL_H=20
GAP=16
HEADING_X=20
SWATCH_X0=120
# Canvas
CANVAS_W=760
CANVAS_H=1120
# We build an MVG (Magick Vector Graphics) draw string
MVG=""
# Title
MVG="$MVG fill '#f0fef0' font-size 22 font 'Liberation-Sans-Bold' text 20,38 'Dupre Theme Color Palette' "
Y=70
draw_group() {
heading="$1"
shift
# Heading label (vertically centered with swatches)
head_y=$((Y + SWATCH_H / 2 + 6))
MVG="$MVG fill '#969385' font-size 16 font 'Liberation-Sans-Bold' text ${HEADING_X},${head_y} '${heading}' "
X=$SWATCH_X0
while [ $# -gt 0 ]; do
name="$1"; hex="$2"; shift 2
# Swatch
x2=$((X + SWATCH_W - 1))
y2=$((Y + SWATCH_H - 1))
MVG="$MVG fill '${hex}' roundrectangle ${X},${Y} ${x2},${y2} 8,8 "
# Label
label_y=$((Y + SWATCH_H + 14))
MVG="$MVG fill '#969385' font-size 13 font 'Liberation-Mono' text ${X},${label_y} '${name} : ${hex}' "
X=$((X + SWATCH_W + GAP))
done
Y=$((Y + SWATCH_H + LABEL_H + GAP))
}
draw_group "BG" bg "#151311" bg+2 "#474544"
draw_group "FG" fg "#f0fef0" gray+2 "#d0cbc0"
draw_group "Neutrals" black "#252321" muted "#58574e" steel "#969385"
draw_group "Yellows" yellow "#d7af5f" yellow+1 "#ffd75f"
draw_group "Reds" red "#d47c59" red+1 "#edb08f"
draw_group "Greens" green "#a4ac64" green+1 "#ccc768"
draw_group "Blues" blue "#67809c" blue+1 "#b2c3cc"
draw_group "Cyans" cyan "#8a9496" cyan+1 "#acb0b3"
draw_group "Magentas" magenta "#b294bb" magenta+1 "#c397d8"
magick -size "${CANVAS_W}x${CANVAS_H}" "xc:#1a1a1a" -draw "$MVG" "$OUTPUT"
echo "Generated: $OUTPUT"
|