Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base16 Shell
See the [Base16 repository](https://github.com/chriskempson/base16) for more information.
See the [Base16 repository](https://github.com/chriskempson/base16) for more information.
These scripts were built with [Base16 Builder PHP](https://github.com/chriskempson/base16-builder-php).

A shell script to change your shell's default ANSI colors but most importantly, colors 17 to 21 of your shell's 256 colorspace (if supported by your terminal). This script makes it possible to honor the original bright colors of your shell (e.g. bright green is still green and so on) while providing additional base16 colors to applications such as Vim.
Expand All @@ -8,7 +8,7 @@ A shell script to change your shell's default ANSI colors but most importantly,

## Use Cases

* You want to use a `*.256.*` variant of a Terminal theme designed to honor the original bright colors.
* You want to use a `*.256.*` variant of a Terminal theme designed to honor the original bright colors (default 16 colors also implemented).
* You prefer to use a script instead of a terminal emulator theme to color your shell.
* You use this script to have different colorschemes appear on different SSH sessions.

Expand All @@ -27,6 +27,8 @@ Add following lines to `~/.bashrc` or `~/.zshrc`:
```bash
# Base16 Shell
BASE16_SHELL="$HOME/.config/base16-shell/"
# Uncomment the following line if you want the default 16 colors template
#export BASE16_SHELL_DEFAULT_VARIANT="1"
[ -n "$PS1" ] && \
[ -s "$BASE16_SHELL/profile_helper.sh" ] && \
eval "$("$BASE16_SHELL/profile_helper.sh")"
Expand All @@ -42,6 +44,8 @@ Add following lines to `~/.config/fish/config.fish`:
# Base16 Shell
if status --is-interactive
set BASE16_SHELL "$HOME/.config/base16-shell/"
# Uncomment the following line if you want the default 16 colors template
#set -x BASE16_SHELL_DEFAULT_VARIANT "1"
source "$BASE16_SHELL/profile_helper.fish"
end
```
Expand All @@ -53,13 +57,14 @@ Open a new shell and type `base16` followed by a tab to perform tab completion.
the profile_helper will update a ~/.vimrc_background file that will have your current the colorscheme, you just need to source this file in your vimrc: i.e. (remove the base16colorspace line if not needed)

if filereadable(expand("~/.vimrc_background"))
" Comment the following line if you are using the default 16 colors template
let base16colorspace=256
source ~/.vimrc_background
endif

## Troubleshooting

Run the included **colortest** script and check that your colour assignments appear correct. If your teminal does not support the setting of colours in within the 256 colorspace (e.g. Apple Terminal), colours 17 to 21 will appear blue.
Run the included **colortest** script and check that your colour assignments appear correct. If your teminal does not support the setting of colours in within the 256 colorspace (e.g. Apple Terminal), colours 17 to 21 will appear blue. In this situation, you can use the default 16 colors variant (see the [Configuration](#Configuration) section above).

![setting 256 colourspace not supported](https://raw.github.com/chriskempson/base16-shell/master/setting-256-colourspace-not-supported.png)

Expand Down
22 changes: 13 additions & 9 deletions colortest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ theme=$(dirname $0)/scripts/${1:-base16-default-dark.sh}
if [ -f $theme ]; then
# get the color declarations in said theme, assumes there is a block of text that starts with color00= and ends with new line
source $theme
eval $(awk '/^color00=/,/^$/ {print}' $theme | sed 's/#.*//')
eval $(awk "/^color00=/,/^$/ {print}" $theme | sed -E 's/#.*//;s/^(if.*|else|fi;)$/;\1/')
else
printf "No theme file %s found\n" $theme
fi;
Expand Down Expand Up @@ -42,21 +42,25 @@ colors=(
base0E
base0C
base07
base09
base0F
base01
base02
base04
base06
)
for padded_value in `seq -w 0 21`; do
if [ -z "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
colors+=(
base09
base0F
base01
base02
base04
base06
)
fi
for padded_value in `seq -w 0 $((${#colors[@]}-1))`; do
color_variable="color${padded_value}"
eval current_color=\$${color_variable}
current_color=$(echo ${current_color//\//} | tr '[:lower:]' '[:upper:]') # get rid of slashes, and uppercase
non_padded_value=$((10#$padded_value))
base16_color_name=${colors[$non_padded_value]}
current_color_label=${current_color:-unknown}
ansi_label=${ansi_mappings[$non_padded_value]}
ansi_label=${ansi_mappings[$non_padded_value]}
block=$(printf "\x1b[48;5;${non_padded_value}m___________________________")
foreground=$(printf "\x1b[38;5;${non_padded_value}m$color_variable")
printf "%s %s %s %-30s %s\x1b[0m\n" $foreground $base16_color_name $current_color_label ${ansi_label:-""} $block
Expand Down
55 changes: 34 additions & 21 deletions scripts/base16-3024.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,31 @@ color04="01/a0/e4" # Base 0D - Blue
color05="a1/6a/94" # Base 0E - Magenta
color06="b5/e4/f4" # Base 0C - Cyan
color07="a5/a2/a2" # Base 05 - White
color08="5c/58/55" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="f7/f7/f7" # Base 07 - Bright White
color16="e8/bb/d0" # Base 09
color17="cd/ab/53" # Base 0F
color18="3a/34/32" # Base 01
color19="4a/45/43" # Base 02
color20="80/7d/7c" # Base 04
color21="d6/d5/d4" # Base 06
if [ -n "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
color08="5c/58/55" # Base 03 - Bright Black
color09="e8/bb/d0" # Base 09
color10="3a/34/32" # Base 01
color11="4a/45/43" # Base 02
color12="80/7d/7c" # Base 04
color13="d6/d5/d4" # Base 06
color14="cd/ab/53" # Base 0F
color15="f7/f7/f7" # Base 07 - Bright White
else
color08="5c/58/55" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="f7/f7/f7" # Base 07 - Bright White
color16="e8/bb/d0" # Base 09
color17="cd/ab/53" # Base 0F
color18="3a/34/32" # Base 01
color19="4a/45/43" # Base 02
color20="80/7d/7c" # Base 04
color21="d6/d5/d4" # Base 06
fi;
color_foreground="a5/a2/a2" # Base 05
color_background="09/03/00" # Base 00

Expand Down Expand Up @@ -67,13 +78,15 @@ put_template 13 $color13
put_template 14 $color14
put_template 15 $color15

# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21
if [ -z "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21
fi

# foreground / background / cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
Expand Down
55 changes: 34 additions & 21 deletions scripts/base16-apathy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,31 @@ color04="96/88/3E" # Base 0D - Blue
color05="4C/96/3E" # Base 0E - Magenta
color06="96/3E/4C" # Base 0C - Cyan
color07="81/B5/AC" # Base 05 - White
color08="2B/68/5E" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="D2/E7/E4" # Base 07 - Bright White
color16="3E/79/96" # Base 09
color17="3E/96/5B" # Base 0F
color18="0B/34/2D" # Base 01
color19="18/4E/45" # Base 02
color20="5F/9C/92" # Base 04
color21="A7/CE/C8" # Base 06
if [ -n "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
color08="2B/68/5E" # Base 03 - Bright Black
color09="3E/79/96" # Base 09
color10="0B/34/2D" # Base 01
color11="18/4E/45" # Base 02
color12="5F/9C/92" # Base 04
color13="A7/CE/C8" # Base 06
color14="3E/96/5B" # Base 0F
color15="D2/E7/E4" # Base 07 - Bright White
else
color08="2B/68/5E" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="D2/E7/E4" # Base 07 - Bright White
color16="3E/79/96" # Base 09
color17="3E/96/5B" # Base 0F
color18="0B/34/2D" # Base 01
color19="18/4E/45" # Base 02
color20="5F/9C/92" # Base 04
color21="A7/CE/C8" # Base 06
fi;
color_foreground="81/B5/AC" # Base 05
color_background="03/1A/16" # Base 00

Expand Down Expand Up @@ -67,13 +78,15 @@ put_template 13 $color13
put_template 14 $color14
put_template 15 $color15

# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21
if [ -z "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21
fi

# foreground / background / cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
Expand Down
55 changes: 34 additions & 21 deletions scripts/base16-ashes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,31 @@ color04="AE/95/C7" # Base 0D - Blue
color05="C7/95/AE" # Base 0E - Magenta
color06="95/AE/C7" # Base 0C - Cyan
color07="C7/CC/D1" # Base 05 - White
color08="74/7C/84" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="F3/F4/F5" # Base 07 - Bright White
color16="C7/C7/95" # Base 09
color17="C7/95/95" # Base 0F
color18="39/3F/45" # Base 01
color19="56/5E/65" # Base 02
color20="AD/B3/BA" # Base 04
color21="DF/E2/E5" # Base 06
if [ -n "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
color08="74/7C/84" # Base 03 - Bright Black
color09="C7/C7/95" # Base 09
color10="39/3F/45" # Base 01
color11="56/5E/65" # Base 02
color12="AD/B3/BA" # Base 04
color13="DF/E2/E5" # Base 06
color14="C7/95/95" # Base 0F
color15="F3/F4/F5" # Base 07 - Bright White
else
color08="74/7C/84" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="F3/F4/F5" # Base 07 - Bright White
color16="C7/C7/95" # Base 09
color17="C7/95/95" # Base 0F
color18="39/3F/45" # Base 01
color19="56/5E/65" # Base 02
color20="AD/B3/BA" # Base 04
color21="DF/E2/E5" # Base 06
fi;
color_foreground="C7/CC/D1" # Base 05
color_background="1C/20/23" # Base 00

Expand Down Expand Up @@ -67,13 +78,15 @@ put_template 13 $color13
put_template 14 $color14
put_template 15 $color15

# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21
if [ -z "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21
fi

# foreground / background / cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
Expand Down
55 changes: 34 additions & 21 deletions scripts/base16-atelier-cave-light.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,31 @@ color04="57/6d/db" # Base 0D - Blue
color05="95/5a/e7" # Base 0E - Magenta
color06="39/8b/c6" # Base 0C - Cyan
color07="58/52/60" # Base 05 - White
color08="7e/78/87" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="19/17/1c" # Base 07 - Bright White
color16="aa/57/3c" # Base 09
color17="bf/40/bf" # Base 0F
color18="e2/df/e7" # Base 01
color19="8b/87/92" # Base 02
color20="65/5f/6d" # Base 04
color21="26/23/2a" # Base 06
if [ -n "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
color08="7e/78/87" # Base 03 - Bright Black
color09="aa/57/3c" # Base 09
color10="e2/df/e7" # Base 01
color11="8b/87/92" # Base 02
color12="65/5f/6d" # Base 04
color13="26/23/2a" # Base 06
color14="bf/40/bf" # Base 0F
color15="19/17/1c" # Base 07 - Bright White
else
color08="7e/78/87" # Base 03 - Bright Black
color09=$color01 # Base 08 - Bright Red
color10=$color02 # Base 0B - Bright Green
color11=$color03 # Base 0A - Bright Yellow
color12=$color04 # Base 0D - Bright Blue
color13=$color05 # Base 0E - Bright Magenta
color14=$color06 # Base 0C - Bright Cyan
color15="19/17/1c" # Base 07 - Bright White
color16="aa/57/3c" # Base 09
color17="bf/40/bf" # Base 0F
color18="e2/df/e7" # Base 01
color19="8b/87/92" # Base 02
color20="65/5f/6d" # Base 04
color21="26/23/2a" # Base 06
fi;
color_foreground="58/52/60" # Base 05
color_background="ef/ec/f4" # Base 00

Expand Down Expand Up @@ -67,13 +78,15 @@ put_template 13 $color13
put_template 14 $color14
put_template 15 $color15

# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21
if [ -z "$BASE16_SHELL_DEFAULT_VARIANT" ]; then
# 256 color space
put_template 16 $color16
put_template 17 $color17
put_template 18 $color18
put_template 19 $color19
put_template 20 $color20
put_template 21 $color21
fi

# foreground / background / cursor color
if [ -n "$ITERM_SESSION_ID" ]; then
Expand Down
Loading