Template:Colort/Color/doc

Color table row, for use with Colort, which creates the column headings.

Usage

 * common name – may contain markup
 * alternative name or html name
 * sort name – an alternative name or spelling that should be used for sorting, must not contain markup
 * red decimal value – 0–255, percent values are automatically generated
 * green decimal value – 0–255, percent values are automatically generated
 * blue decimal value – 0–255, percent values are automatically generated
 * hex triplet – can be automatically generated
 * hue degrees – HSV/HSB and HSL, can be automatically generated
 * saturation percent – HSV/HSB, can be automatically generated
 * brightness/value percent – HSV/HSB, can be automatically generated
 * saturation percent – HSL, can be automatically generated
 * lightness percent – HSL, can be automatically generated
 * brightness/value percent – HSV/HSB, can be automatically generated
 * saturation percent – HSL, can be automatically generated
 * lightness percent – HSL, can be automatically generated

If not provided, values for HSL, HSV and hex triplet are auto-generated from RGB parameters. That means, parameters name, r, g and b are required, the rest is optional and mostly should only be used if the automatic calculation yields rounding errors or fails for other reasons.

The hash sign  for hex triplets, percent   and degree   symbols must not be entered as they are included automatically.

Parameters
{ "description": "Table row with digital color data, usually in 11 or 12 columns.", "params": { "name": { "label": "common name", "description": "the vulgar color name, may contain markup", "type": "string/line", "required": true }, "alias": { "label": "alternative name", "description": "usually used for synonymous names, but may be used for arbitrary content if the last column header is changed", "type": "string/line", "aliases": ["html_name"], "required": false }, "html_name": { "label": "(deprecated)", "description": "legacy variant of alias parameter, kept for backwards compatibility only", "type": "string/line", "required": false, "deprecated": "true" }, "sort": { "label": "sort name", "description": "an alternative name or spelling that should be used for sorting, must not contain markup like links", "type": "string/line", "required": false }, "code": { "label": "code name", "description": "the color name as used in computer code (e.g. special capitalization or spelling with hyphens, underscores or spaces), must not contain markup", "type": "string/line", "required": false }, "link": { "label": "color article", "description": "the Wikipedia article title explaining this color, must not contain markup", "type": "string/wiki-page-name", "required": false }, "r": { "label": "red component (RGB)", "description": "decimal 8bit value (0–255), percent value is generated automatically", "type": "number", "default": "0", "required": true }, "g": { "label": "green component (RGB)", "description": "decimal 8bit value (0–255), percent value is generated automatically", "type": "number", "default": "0", "required": true }, "b": { "label": "blue component (RGB)", "description": "decimal 8bit value (0–255), percent value is generated automatically", "type": "number", "default": "0", "required": true }, "hex": { "label": "hex triplet (RGB)", "description": "six hexadecimal digits, automatically preceded by a hash sign (#) as used in several computer languages, e.g. CSS", "type": "string/line", "default": "generated from r, g, b", "required": false }, "h": { "label": "hue (HSB/HSV, HSL)", "description": "in degrees (0–359), automatically succeeded by degrees sign (°)", "type": "number", "default": "generated from r, g, b", "required": false }, "s": { "label": "saturation (HSB/HSV)", "description": "percentage (0–100), automatically succeeded by percent sign (%), usually differs from HSL saturation", "type": "number", "default": "generated from r, g, b", "required": false }, "v": { "label": "brightness/value (HSB/HSV)", "description": "percentage (0–100), automatically succeeded by percent sign", "type": "number", "default": "generated from r, g, b", "required": false }, "sat": { "label": "saturation (HSL)", "description": "percentage (0–100), automatically succeeded by percent sign (%), usually differs from HSV/HSB saturation", "type": "number", "default": "generated from r, g, b", "required": false }, "l": { "label": "lightness/luminance (HSL)", "description": "percentage (0–100), automatically succeeded by percent sign (%)", "type": "number", "default": "generated from r, g, b", "required": false }, "narrow": { "label": "narrow layout switch", "description": "if specified this parameters changes the layout to a narrower one that covers two rows, must be specified for all neighboring rows too", "type": "string/line", "required": false }, "padding": { "label": "extra right padding", "description": "a valid CSS length value, usually set appropriately to care for sort buttons in column headers, should be specified for all neighboring rows too", "type": "string/line", "default": "21px (0 if narrow)", "required": false }, "width": { "label": "color sample column width", "description": "a valid CSS length value setting the width of the first column, should be specified for all neighboring rows too", "type": "string/line", "default": "4em (1em if narrow)", "required": false }, "border": { "label": "border color", "description": "a valid CSS color value or name for the color of cell borders, usually a light gray", "type": "string/line", "default": "#AAA", "required": false }, "link target": { "label": "TOC anchor", "description": "provides a link target, especially for links from the table of contents, should usually be specified only for the first color name starting with a certain letter in an alphabetically sorted list, to said letter, uppercase", "type": "string/line", "required": false } }}

Examples
See X11 color names, Web colors, or "what links here".

Code
The colort/Color template provides the calculation of missing values, the actual table row design is found in colort/1row. This sub-template should never be used directly elsewhere!