~tardypad/dotfiles

ref: HEAD dotfiles/utilities/list-colors-hex -rwxr-xr-x 375 bytes
2a7e6d96Damien Tardy-Panis Add missing backup-dir in backup script for quickmarks 6 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# list hexadecimal values of base colors

THEME="$1"

if [ -z "${THEME}" ]; then
  printf 'missing theme argument\n' >&2
  exit 1
fi

BASE_COLORS_FILE="config/colors/base_${THEME}"

if [ ! -f "${BASE_COLORS_FILE}" ]; then
  printf "invalid theme '%s'\n" "${THEME}" >&2
  exit 1
fi

sed -n 's/| base0[[:alnum:]] | #\([[:alnum:]]\+\) |.*/\1/p' "${BASE_COLORS_FILE}"