About

This page and the attached code help you to display the actual protestant liturgical colour (colours of the Church Year) on your website. The base for the libraries comes from http://www.crivoice.org/colorsof.html.

Usage

Online

Just include this css or js from your website, and use the predefined "hcolor" class or the JavaScript variables.
NOTE: this is experimental, the site runs on the free version of Google Apps, if the free limit should be exhausted, I might limit the usage of the feature.

Python

The Python lib provides a class, called LiturgicalYear, the constructor can be either a date in %Y-%m-%d format, or undefined (for today). The four relevant class variables are: holiday (the current location in the liturgical year), holiday_color (the current colour), moving_dates (dictionary with the moving holidays in the given year), holidays (array with all holidays in the given year.)
LiturgicalYear.py
from LiturgicalYear import *        
ly = LiturgicalYear()
print ly.holiday + " " + ly.holiday_color
    

PHP

The PHP version of the code is not that scientific, it just does something structured and that's it.
liturgicalcolour.php
include('liturgicalcolour.php');
print "$holiday $holiday_color";
    

Javascript

The Javascript version provides the getLiturgicalColour() function which takes a Date object (default is now of course), and returns an array which contains the holiday name and the appropriate colour (in the 'name' and 'color' member variables).
LiturgicalYear.js
<script src="LiturgicalYear.js"></script>
<script>
var holiday = getLiturgicalColour();
document.write(holiday.name + " " + holiday.color);
</script>
    

Demo

is , the liturgical colour is .
Choose another date: ok  reset