Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
protesilaos committed Nov 19, 2017
0 parents commit 05b3d1c
Show file tree
Hide file tree
Showing 41 changed files with 2,204 additions and 0 deletions.
675 changes: 675 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions README.md
@@ -0,0 +1,47 @@
# Tempus themes (by Protesilaos Stavrou)

*Tempus* is a collection of themes for Vim and terminal emulators that are compliant *at the very least* with the WCAG AA accessibility standard for colour contrast (which stands for a contrast ratio of 4.50:1).

Each theme consists of a 16-colour palette that corresponds to the basic values provided by all modern terminal emulators, namely: black, red, green, yellow, blue, magenta, cyan, white, bright black, bright red, bright green, bright yellow, bright blue, bright magenta, bright cyan, bright white.

Unlike my other project on the same issue, [Prot16](https://protesilaos.com/schemes), Tempus themes come in either a dark or a light variant. That means that the desired colour contrast is only met by combining any of the foreground values against one of two backgrounds.

The current collection features four dark themes—where dark values are primarily used as the backdrop—and one light (the light theme—`totus`—is WCAG AAA compliant or else has a contrast ratio of 7.00:1).

Tempus themes are interoperable. They are meant to work as a one-to-one replacement to each other within the same contrast ratio boundary. This is due to their inherent colour qualities as well as their shared schema for mapping colours to objects of the code syntax. Put concretely:

- **Same contrast.** Every Tempus theme with a WCAG AA rating can 100% substitute all themes with the same rating (will also be true for the WCAG AAA standard once more themes within that category are available).
- **Same structure.** The shared colour mapping means that a code *constant* will always be blue while a *string* will always be a bright blue regardless of which specific Tempus theme is used (and so on for all constructs).

For the time being, the colour mapping specs are implemented in Vim. The plan is to develop templates for other popular applications, such as Atom and Emacs.

## Screenshots

Tempus Totus (WCAG AAA)
![tempus_totus sample](https://raw.githubusercontent.com/protesilaos/tempus-themes/master/screenshots/tempus_totus.png)

Tempus Spring (WCAG AA)
![tempus_spring sample](https://raw.githubusercontent.com/protesilaos/tempus-themes/master/screenshots/tempus_spring.png)

Tempus Summer (WCAG AA)
![tempus_summer sample](https://raw.githubusercontent.com/protesilaos/tempus-themes/master/screenshots/tempus_summer.png)

Tempus Autumn (WCAG AA)
![tempus_autumn sample](https://raw.githubusercontent.com/protesilaos/tempus-themes/master/screenshots/tempus_autumn.png)

Tempus Winter (WCAG AA)
![tempus_winter sample](https://raw.githubusercontent.com/protesilaos/tempus-themes/master/screenshots/tempus_winter.png)

## How to use this repo

Each directory contains files specific to the application it references. For example, the `urxvt` directory includes an `.Xresources` file for each item in the Tempus collection.

Instructions on how to use these files are documented in the `README.md` which is included in each directory.

## Contributing

You are most welcome to contribute a template for developing ports of the Tempus collection. For your reference, the tool for producing the Tempus themes is located in another repository: [Tempus Themes Generator](https://github.com/protesilaos/tempus-themes-generator). It accepts data files with the colour values, parses them through templates to deliver the desired result (using the terminal's standard output).

## License

GNU General Public License Version 3.
52 changes: 52 additions & 0 deletions build-all.sh
@@ -0,0 +1,52 @@
#!/bin/bash

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Builds all content files for all items of the Tempus Themes collection
# This is a utility intended for automating the process of mainting the relevant repos

# IMPORTANT The script requires the tempus-themes-generator git repo at the home directory
# git clone https://github.com/protesilaos/tempus-themes-generator.git --depth 1

# Variables for the operations
tempusdir=$HOME/tempus-themes
generator=$tempusdir-generator/./tempus-themes-generator.sh
templates=$(ls $tempusdir-generator/templates)
schemes=$(ls $tempusdir-generator/schemes)

# Dynamically create the necessary directories
# File path: ~/tempus-themes/{template}/tempus_{scheme}.{file extension}
for i in $templates
do
mkdir -p $tempusdir/$i
done

# Build all files for each item in the array
for i in $schemes
do
$generator $i urxvt > $tempusdir/urxvt/tempus_$i.Xresources
echo "Preparing $i RXVT-Unicode (urvxt) files"

$generator $i vim > $tempusdir/vim/tempus_${i}.vim
echo "Preparing $i Vim files"

$generator $i xfce4-terminal > $tempusdir/xfce4-terminal/tempus_$i.theme
echo "Preparing $i Xfce4-terminal files"

$generator $i xterm > $tempusdir/xterm/tempus_$i.Xresources
echo "Preparing $i xterm files"

$generator $i yaml > $tempusdir/yaml/tempus_$i.yml
echo "Preparing $i YAML files"
done
37 changes: 37 additions & 0 deletions export-urxvt.sh
@@ -0,0 +1,37 @@
#!/bin/bash

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Builds all Urxvt content files for all items of the Tempus Themes collection
# This is a utility intended for automating the process of mainting the relevant repos

# IMPORTANT The script requires the tempus-themes-generator git repo at the home directory
# git clone https://github.com/protesilaos/tempus-themes-generator.git --depth 1

# Variables for the operations
tempusdir=$HOME/tempus-themes
outputdir=$tempusdir-urxvt
generator=$tempusdir-generator/./tempus-themes-generator.sh
schemes=$(ls $tempusdir-generator/schemes)

# Create the directory
mkdir -p $outputdir

# Build all files for each item in the array
for i in $schemes
do
$generator $i urxvt > $outputdir/tempus_${i}.Xresources
$generator $i urxvt > $outputdir/tempus_${i}.Xcolors
echo "Preparing $i RXVT-Unicode (urvxt) files"
done
36 changes: 36 additions & 0 deletions export-vim.sh
@@ -0,0 +1,36 @@
#!/bin/bash

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Builds all Vim content files for all items of the Tempus Themes collection
# This is a utility intended for automating the process of mainting the relevant repos

# IMPORTANT The script requires the tempus-themes-generator git repo at the home directory
# git clone https://github.com/protesilaos/tempus-themes-generator.git --depth 1

# Variables for the operations
tempusdir=$HOME/tempus-themes
outputdir=$tempusdir-vim/colors
generator=$tempusdir-generator/./tempus-themes-generator.sh
schemes=$(ls $tempusdir-generator/schemes)

# Create the directory
mkdir -p $outputdir

# Build all files for each item in the array
for i in $schemes
do
$generator $i vim > $outputdir/tempus_${i}.vim
echo "Preparing $i Vim files"
done
36 changes: 36 additions & 0 deletions export-xfce4-terminal.sh
@@ -0,0 +1,36 @@
#!/bin/bash

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Builds all Xfce4-terminal content files for all items of the Tempus Themes collection
# This is a utility intended for automating the process of mainting the relevant repos

# IMPORTANT The script requires the tempus-themes-generator git repo at the home directory
# git clone https://github.com/protesilaos/tempus-themes-generator.git --depth 1

# Variables for the operations
tempusdir=$HOME/tempus-themes
outputdir=$tempusdir-xfce4-terminal
generator=$tempusdir-generator/./tempus-themes-generator.sh
schemes=$(ls $tempusdir-generator/schemes)

# Create the directory
mkdir -p $outputdir

# Build all files for each item in the array
for i in $schemes
do
$generator $i xfce4-terminal > $outputdir/tempus_${i}.theme
echo "Preparing $i Xfce4-terminal files"
done
37 changes: 37 additions & 0 deletions export-xterm.sh
@@ -0,0 +1,37 @@
#!/bin/bash

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Builds all Xterm content files for all items of the Tempus Themes collection
# This is a utility intended for automating the process of mainting the relevant repos

# IMPORTANT The script requires the tempus-themes-generator git repo at the home directory
# git clone https://github.com/protesilaos/tempus-themes-generator.git --depth 1

# Variables for the operations
tempusdir=$HOME/tempus-themes
outputdir=$tempusdir-xterm
generator=$tempusdir-generator/./tempus-themes-generator.sh
schemes=$(ls $tempusdir-generator/schemes)

# Create the directory
mkdir -p $outputdir

# Build all files for each item in the array
for i in $schemes
do
$generator $i xterm > $outputdir/tempus_${i}.Xresources
$generator $i xterm > $outputdir/tempus_${i}.Xcolors
echo "Preparing $i Xterm files"
done
Binary file added screenshots/tempus_autumn.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/tempus_spring.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/tempus_summer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/tempus_totus.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/tempus_winter.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions urxvt/README.md
@@ -0,0 +1,59 @@
# Tempus Themes for RXVT-Unicode (urxvt)

Urxvt saves colour values in either of two places. The most common use case is within the `~/.Xresources`. The other is by sourcing an `Xcolors` file. This document will walk you through the process.

## We use the command line

Start by cloning the `tempus-themes-urxvt` repo and entering it (unless you prefer copy-pasting, in which case adapt accordingly):

```sh
git clone https://github.com/protesilaos/tempus-themes-urxvt.git --depth 1 && cd tempus-themes-urxvt
```

## Adding colours to Xresources

Now you want to **append** the content of the theme to your `.Xresources`. You need to append it, otherwise you will overwrite its contents. As such, run the following command, substituting [SCHEME-NAME] with the one you want:

```sh
cat [SCHEME-NAME] >> ~/.Xresources
```

For example, if you want `tempus_winter`:

```sh
cat tempus_winter.Xcolors >> ~/.Xresources
```

It is important to note the use of `>>`. It is the command that appends the content to the file. Be careful if you are typing this. A single `>` will overwrite the file's contents.

## Sourcing colours from the Xresources

The other approach to having colour values for urxvt is to source an `Xcolors` file from within the `.Xresources`. The file can be located anywhere.

For the purposes of this tutorial, it is assumed you have created a hidden directory `~/.urxvt-themes/` from where the `Xcolors` will be sourced. Execute the commands on the lines below that do not start with a `#` (those are just comments):

```sh
# Create hidden directory for urxvt Xcolors
# Hidden directories start with a dot `.`
mkdir ~/.urxvt-themes

# Copy desired theme to that directory
# Using tempus_winter as an example
cp tempus_winter.Xcolors ~/.urxvt-themes/
```

Then source that file from within the `.Xresources` with the following line (note that comments in `.Xresources` start with a `!`, not an `#`):

```
#include </home/YOUR-USERNAME/.urxvt-themes/tempus_winter.Xcolors>
```

## Almost done

Whatever method you use, do not forget to reload the configurations, with the command `xrdb -merge ~/.Xresources` (may need to close all terminals and re-open them).

Enjoy!

## Additional resources

Urxvt is my favourite terminal. Check out my [dotfiles](https://github.com/protesilaos/dotfiles) if you need any inspiration.
22 changes: 22 additions & 0 deletions urxvt/tempus_autumn.Xresources
@@ -0,0 +1,22 @@
! vi: ft=xdefaults
! Colour scheme: Tempus autumn
! By Protesilaos Stavrou
URxvt*background: #322622
URxvt*foreground: #8e8f8d
URxvt*cursorColor: #8e8f8d
URxvt*color0: #322622
URxvt*color1: #fc5526
URxvt*color2: #83973f
URxvt*color3: #9e9022
URxvt*color4: #7f8dbf
URxvt*color5: #ce7673
URxvt*color6: #6e978b
URxvt*color7: #919078
URxvt*color8: #35260f
URxvt*color9: #dc721a
URxvt*color10: #609d59
URxvt*color11: #b1891a
URxvt*color12: #6b8ed6
URxvt*color13: #9d80d3
URxvt*color14: #229ea0
URxvt*color15: #8e8f8d
22 changes: 22 additions & 0 deletions urxvt/tempus_spring.Xresources
@@ -0,0 +1,22 @@
! vi: ft=xdefaults
! Colour scheme: Tempus spring
! By Protesilaos Stavrou
URxvt*background: #34403c
URxvt*foreground: #a5a8a7
URxvt*cursorColor: #a5a8a7
URxvt*color0: #34403c
URxvt*color1: #ff855a
URxvt*color2: #6ab78a
URxvt*color3: #b6aa1a
URxvt*color4: #5daeee
URxvt*color5: #d495b4
URxvt*color6: #6eb2bc
URxvt*color7: #96aca7
URxvt*color8: #2a423d
URxvt*color9: #df993a
URxvt*color10: #4abb88
URxvt*color11: #99b22a
URxvt*color12: #3caffe
URxvt*color13: #d091db
URxvt*color14: #4ab4d3
URxvt*color15: #a5a8a7
22 changes: 22 additions & 0 deletions urxvt/tempus_summer.Xresources
@@ -0,0 +1,22 @@
! vi: ft=xdefaults
! Colour scheme: Tempus summer
! By Protesilaos Stavrou
URxvt*background: #293345
URxvt*foreground: #9b999e
URxvt*cursorColor: #9b999e
URxvt*color0: #293345
URxvt*color1: #fe6d32
URxvt*color2: #6ba86d
URxvt*color3: #af9a0a
URxvt*color4: #679ed7
URxvt*color5: #bc8ab6
URxvt*color6: #6ea590
URxvt*color7: #a39799
URxvt*color8: #352f49
URxvt*color9: #df8251
URxvt*color10: #7aa747
URxvt*color11: #ba953a
URxvt*color12: #3ba1e8
URxvt*color13: #c97ed7
URxvt*color14: #52a6b1
URxvt*color15: #9b999e

0 comments on commit 05b3d1c

Please sign in to comment.