The Liturgical Colour app

This is an article about the ancient traditions of the Christian Church, and the modern principles of developing software. Probably not much of an intersection there!

Seasons

For those who don’t know, most churches have a concept of liturgical seasons and colours. These vary a bit between denominations (i.e. Anglican, Catholic, Protestant, Episcopal, Lutheran, etc) and countries, so for this article I’m specifically talking about the Church of England, which is a member of the Anglican Church. There is a lot of jargon involved so I’ll try and keep to plain English wherever I can – that includes church jargon and software jargon!

Some seasons, everyone will have heard of (like Advent, Christmas and Lent) but there are some other seasons that you might only know about if you go to church (like Pentecost and Trinity). Some of these seasons are related to Christmas – which has a fixed date every year, and some are related to Easter – which moves around each year according to the cycles of the moon.

On top of the irregular seasons, there is a calendar of Holy Days which includes the big days that everyone knows (Christmas and Easter) but also many days throughout the year dedicated to saints, martyrs and Biblical events. There is a priority system to work out what happens if one of the movable days like Easter happens to land on one of the non-movable days. Sometimes they share, and the day therefore marks both dedications. Sometimes the more important dedication cancels the less important dedication. If a dedication is cancelled, sometimes it gets shunted to a different day. Other times it just gets skipped for that year.

Colours

Each season has its own colour which is typically reflected in the altar hangings (tablecloths), the garments worn by the priest, other decorations around the church building, and maybe even the flowers that are on display.

Example of liturgical colours in garments

Some, but not all, of these Holy Days have their own colour which overrides the colour of the season.

Rules

All of these rules mean it is rather complicated to work out what this year’s seasons are, what dedications fall on which days, and what the colour is. Fortunately, the Church of England publishes an annual book called the Lectionary, which is basically a calendar that contains all of that year’s information about seasons, Holy Days, colours, readings, etc. This is usually good enough for typical church business like planning services and remembering when to change the altar hangings.

The Church of England Lectionary

Algorithm

It’s not good enough for me, though. I want a way of automatically working out the dates, the seasons, and the colours. This means I have to reimplement the same algorithm used to work all this stuff out, and then seed the algorithm with a list of Holy Days.

I looked around for existing open-source projects that can calculate liturgical dates and colours. There were a few, but they were mostly focused on the Roman Catholic Church, and none of them were written in languages I knew well.

Then I found a Perl module called DateTime::Calendar::Liturgical::Christian which is aimed at the US Episcopal Church, which seems to have a fair bit of commonality with the Anglican church. I know a bit of Perl, so I ported this module to Python (the main language I use now), tweaked the algorithm to reflect the Church of England’s seasons, and replaced the Episcopal Church’s Calendar of the Church Year with the Church of England’s Calendar of Saints, along with its revised priority system.

The end result is a Python library that I have called Liturgical Colour, and which is published on PyPI. Here’s sample output when run for 31st March 2024 – Easter Day:

name : Easter
url : https://en.wikipedia.org/wiki/Easter
prec : 9
type : Principal Feast
type_url : https://en.wikipedia.org/wiki/Principal_Feast
season : Easter
season_url : https://en.wikipedia.org/wiki/Eastertide
weekno : 1
week : Easter 1
date : 2024-03-31
colour : white
colourcode : #ffffff

The output is basic, but includes all the key information – including the name of the colour and the HTML colour code, which leads neatly onto the next section.

App

Now we have a library that can calculate all the required information for any date, we just need a way of displaying the information. I’m no frontend developer, but I managed to throw together a simple Python app based on Flask which uses the Liturgical Colour library and renders a simple display for the user.

Here are some screenshots of example output from different dates. There are also two days per year when the app will display rose pink!

The Liturgical Colour App, aside from lacking a catchy name, has its source code on GitHub and its container image on Docker Hub. There’s also a Helm chart to allow you to deploy it on Kubernetes.

The Liturgical Colour app is publicly available at liturgical.gazeley.uk so everyone can check which saint’s day is on their birthday!

Leave a comment