Module:Color contrast/doc
Appearance
This is the documentation page for Module:Color contrast
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
Lua error in Module:Effective_protection_level at line 64: attempt to index field 'TitleBlacklist' (a nil value).
-->
| This Lua module is used on approximately 578,000 pages. To avoid major disruption and server load, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
| This module depends on the following other modules: |
This module is used primarily by
- {{Color contrast ratio}}
- {{RGBColorToLum}}
- {{Color contrast conformance}}
- {{Ensure AAA contrast ratio}}
- {{Ensure AA contrast ratio}}
- {{Greater color contrast ratio}}
It is also used for tracking within
and for documentation in
The formulas used are stated in WCAG 2.x specifications. WCAG is the main guideline for creating accessible interfaces on the web.
Usage
To use this module, you may use one of the above listed templates or invoke the module directly
- To compute relative luminescence:
<syntaxhighlight lang="wikitext" inline>Template:RGBColorToLum</syntaxhighlight> or <syntaxhighlight lang="wikitext" inline></syntaxhighlight> - To compute a contrast ratio between two colors:
<syntaxhighlight lang="wikitext" inline>Template:Color contrast ratio</syntaxhighlight> or <syntaxhighlight lang="wikitext" inline>?</syntaxhighlight> - To determine which of two colors (color2a and color2b) has the greater contrast ratio with a particular color (color1):
<syntaxhighlight lang="wikitext" inline></syntaxhighlight> or <syntaxhighlight lang="wikitext" inline></syntaxhighlight> - To compute the contrast ratio between the background and text colors specified in a css style string:
<syntaxhighlight lang="wikitext" inline>21</syntaxhighlight>