This template can be used to standardize the colours used to represent Canadian political parties in tables, lists, and templates. Enter the jurisdiction and party name, and this template will produce the hex colour code for that party. In tables, this template can start a new row with one cell containing the colour and the next cell containing a wikilink to the article about that party.

A full list of available party names is at Wikipedia:WikiProject Political parties and politicians in Canada/list of parties.

Usage

[change source]

Where Jur. is the jurisdiction, being one of: CA, AB, BC, MB, NB, NS, NF, NL, NT, NU, ON, PE, QC, SK, YK, YT, EDM, MTL, VAN

Example

[change source]
{|class="wikitable"
((Canadian party colour|BC|NDP|row-name))
| This is the common row-name usage.
((Canadian party colour|MB|CoR|row-name|short))
| Without the "short" parameter, this would have given the full name [[Manitoba Confederation of Regions Party|Confederation of Regions]].
((Canadian party colour|BC|Liberal|row))
| "row" allows custom text in the first cell.
| And, as usual, the second cell.
|-
| ((Canadian party colour|CA|PC|background)) | '''1867'''
| "background" allows text on the colour.
| Note that when using the "background" parameter you have to manually create new rows using |-
((Canadian party colour|XX|Liberal|row-name))
| This row uses "XX" for jurisdiction. Invalid jurisdictions (or jurisdictions without a party by that name) will sometimes find a default colour.
((Canadian party colour|ON|Invalid text|row-name))
| This row uses "Invalid text" as the party name. Invalid party names will default to the colour for independent candidates and will use the exact text entered when using the "row-name" function, including wikilinks. This can be used for parties that only ever run one candidate.
|}

Will produce:

New Democratic This is the common row-name usage.
Conf of Regions Without the "short" parameter, this would have given the full name Confederation of Regions.
  "row" allows custom text in the first cell. And, as usual, the second cell.
1867 "background" allows text on the colour. Note that when using the "background" parameter you have to manually create new rows using |-
Liberal This row uses "XX" for jurisdiction. Invalid jurisdictions (or jurisdictions without a party by that name) will sometimes find a default colour.
Invalid text This row uses "Invalid text" as the party name. Invalid party names will default to the colour for independent candidates and will use the exact text entered when using the "row-name" function, including wikilinks. This can be used for parties that only ever run one candidate.

Replacement of old templates

[change source]

This template is intended to supersede, and simplify, the existing methods of generating party colours, which use a series of at least 769 different templates (down to -5 as of July 28, 2024):

  1. Template:Canadian politics/party colours and /meta/color templates, including
    1. 453 federal and other province subtemplates (now down to -5)
    2. 34 Alberta subtemplates (now all replaced)
    3. 38 Edmonton subtemplates (now all replaced), and
    4. 8 Montreal subtemplates (now all replaced);
  2. political party election (or "row-name") templates, including
    1. 111 federal subtemplates (now all replaced) and
    2. 23 Ontario subtemplates (now all replaced);
  3. 102 /meta/shortname subtemplates (now all replaced).