Template:CellCategory/doc

This template implements an accessible color scheme for table cell backgrounds based on a light Brewer palette called Pastel 2. The generated color code is produced by CategoryBgColor which can be used as a parameter for table legends, boxes and others. Original colors were lightened slightly to achieve WCAG AA with text and links (including inline citations) and may be revised when Wikipedia's default style changes. The order was also changed to promote the pairs least modified by lightening. Pastel 2 was chosen because it is the Brewer palette that requires the least modifications to achieve this accessibility goal.

As a qualitative/categorical palette, these colors should not be used with any specific meaning related to preference (good or bad) or magnitude (intensity, frequency, etc.), and may change in the future, maintaining only the property of serving to differentiate between categories. For comparison tables, see the other table cell templates associated with specific meanings.

Although the WCAG level guarantees the readability of the text, the lightness is about the same in all the colors produced, not following color universal design and, therefore, impacting some colorblind readers. Unfortunately, the only solution to this is to reduce lightness below WCAG AA levels for some colors, decreasing accessibility for many people. Therefore, if the category is important, it should also be represented as text in the table, not just as color.

The palette provides these colors for 8 categories:

Usage example
Wikitext:

Result:

TemplateData
{ "description": "A template for coloring table cells with an accessible qualitative palette.", "params": { "1": {     "label": "category", "description": "category index", "type": "number", "default": "?", "required": false, "suggested": true },   "2": {      "label": "text", "description": "text to fill the cell", "type": "content", "default": "", "required": false, "suggested": false },   "align": { "label": "alignment", "description": "cell text alignment for when the Table alignment template doesn't work; values: 'tl' (top left), 'tc' (top center), 'tr' (top right), 'ml' (middle left), 'mc' (middle center), 'mr' (middle right), 'bl' (bottom left), 'bc' (bottom center), 'br' (bottom right)", "default": "", "type": "line", "required": false, "suggested": false } },  "format": "inline" }