aboutsummaryrefslogtreecommitdiff
path: root/base/colorscheme
blob: 3323c554cb3939b9395094f2f6a206d833bc9160 (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
69
70
71
72
73
#!/bin/bash
# Default Dark scheme by Chris Kempson (http://chriskempson.com)

COLORS=()
#COLORS[ 0]='18/18/18'         # Base 00 - Black
COLORS[ 0]='00/00/00'          # Base 00 - Black
COLORS[ 1]='ab/46/42'          # Base 08 - Red
COLORS[ 2]='a1/b5/6c'          # Base 0B - Green
COLORS[ 3]='f7/ca/88'          # Base 0A - Yellow
COLORS[ 4]='7c/af/c2'          # Base 0D - Blue
COLORS[ 5]='ba/8b/af'          # Base 0E - Magenta
COLORS[ 6]='86/c1/b9'          # Base 0C - Cyan
COLORS[ 7]='d8/d8/d8'          # Base 05 - White
COLORS[ 8]='58/58/58'          # Base 03 - Bright Black
COLORS[ 9]=${COLORS[1]}        # Base 08 - Bright Red
COLORS[10]=${COLORS[2]}        # Base 0B - Bright Green
COLORS[11]=${COLORS[3]}        # Base 0A - Bright Yellow
COLORS[12]=${COLORS[4]}        # Base 0D - Bright Blue
COLORS[13]=${COLORS[5]}        # Base 0E - Bright Magenta
COLORS[14]=${COLORS[6]}        # Base 0C - Bright Cyan
COLORS[15]='f8/f8/f8'          # Base 07 - Bright White
COLORS[16]='dc/96/56'          # Base 09 - Orange
COLORS[17]='a1/69/46'          # Base 0F - Brown
#COLORS[18]='28/28/28'         # Base 01 - Grey 1
COLORS[18]='18/18/18'          # Base 01 - Grey 1
COLORS[19]='38/38/38'          # Base 02 - Grey 2
COLORS[20]='b8/b8/b8'          # Base 04 - Grey 3
COLORS[21]='e8/e8/e8'          # Base 06 - Grey 4
color_foreground=${COLORS[7]}  # Base 05 - White
color_background=${COLORS[0]}  # Base 00 - Black

if [ "${TERM%%-*}" = 'linux' ]; then
  printf_template='\033]P%X%s'
  for i in `seq 0 15`; do
    printf $printf_template $i $(echo ${COLORS[$i]} | tr -d '/')
  done
  echo -ne '\e[H\e[2J'

else
  printf_template='\033]4;%d;rgb:%s\033\\'
  printf_template_var='\033]%d;rgb:%s\033\\'
  printf_template_custom='\033]%s%s\033\\'

  max_color=15
  if [[ $(tput colors) -gt 16 ]]; then max_color=21; fi
  for i in `seq 0 $max_color`; do
    printf $printf_template $i ${COLORS[$i]}
  done

  # foreground / background / cursor color
  if [ "${TERM%%-*}" != 'st' ]; then
    printf $printf_template_var 10 $color_foreground
    if [ "$BASE16_SHELL_SET_BACKGROUND" != false ]; then
      printf $printf_template_var 11 $color_background
      if [ "${TERM%%-*}" = 'rxvt' ]; then
        printf $printf_template_var 708 $color_background # internal border (rxvt)
      fi
    fi
    printf $printf_template_custom 12 ';7' # cursor (reverse video)
  fi

  # clean up
  unset max_color
  unset printf_template
  unset printf_template_var
  unset printf_template_custom
fi

unset COLORS
unset color_foreground
unset color_background

export BASE16_THEME='default-dark'