diff options
Diffstat (limited to 'assets/color-themes/generate-palette.sh')
| -rwxr-xr-x | assets/color-themes/generate-palette.sh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/assets/color-themes/generate-palette.sh b/assets/color-themes/generate-palette.sh new file mode 100755 index 0000000..456d1a4 --- /dev/null +++ b/assets/color-themes/generate-palette.sh @@ -0,0 +1,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" |
