<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.perfecttower2.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AColor_contrast%2Fdoc</id>
	<title>Module:Color contrast/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.perfecttower2.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3AColor_contrast%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://wiki.perfecttower2.com/w/index.php?title=Module:Color_contrast/doc&amp;action=history"/>
	<updated>2026-10-07T15:21:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.perfecttower2.com/w/index.php?title=Module:Color_contrast/doc&amp;diff=4336&amp;oldid=prev</id>
		<title>Speedybrain: Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.perfecttower2.com/w/index.php?title=Module:Color_contrast/doc&amp;diff=4336&amp;oldid=prev"/>
		<updated>2026-10-07T01:50:20Z</updated>

		<summary type="html">&lt;p&gt;Documentation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Computes the relative luminance of CSS colors and the contrast ratio between two colors (the WCAG formula). It is an older copy of [[wikipedia:Module:Color contrast|Wikipedia&amp;#039;s Module:Color contrast]].&lt;br /&gt;
&lt;br /&gt;
On this wiki only [[Module:Navbox]] uses it: on template pages, &amp;lt;code&amp;gt;_styleratio&amp;lt;/code&amp;gt; checks every &amp;lt;code&amp;gt;*style&amp;lt;/code&amp;gt; parameter of a navbox, and a ratio below 4.5 adds the tracking category &amp;quot;Potentially illegible navboxes&amp;quot;. The wrapper templates named at the top of the source (&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Color contrast ratio}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; and others) don&amp;#039;t exist here.&lt;br /&gt;
&lt;br /&gt;
Colors can be CSS names (looked up in [[Module:Color contrast/colors]]), &amp;lt;code&amp;gt;#rgb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;#rrggbb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;rgb()&amp;lt;/code&amp;gt; with numbers or percentages, and &amp;lt;code&amp;gt;hsl()&amp;lt;/code&amp;gt;. A color it can&amp;#039;t read gives an empty string.&lt;br /&gt;
&lt;br /&gt;
Entry points for &amp;lt;code&amp;gt;#invoke&amp;lt;/code&amp;gt; take positional arguments from the invoke, or from the calling template when the invoke has none:&lt;br /&gt;
* &amp;lt;code&amp;gt;lum&amp;lt;/code&amp;gt;: the luminance of color &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, from 0 (black) to 1 (white).&lt;br /&gt;
* &amp;lt;code&amp;gt;ratio&amp;lt;/code&amp;gt;: the contrast ratio of colors &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;error&amp;lt;/code&amp;gt; sets the text for colors it can&amp;#039;t read (default &amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt;).&lt;br /&gt;
* &amp;lt;code&amp;gt;styleratio&amp;lt;/code&amp;gt;: the contrast between &amp;lt;code&amp;gt;background&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;background-color&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;color&amp;lt;/code&amp;gt; in the CSS text &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; are the background and text colors to assume when the CSS doesn&amp;#039;t set them (white and black).&lt;br /&gt;
* &amp;lt;code&amp;gt;greatercontrast&amp;lt;/code&amp;gt;: of colors &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; (default white) and &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; (default black), the one with more contrast against color &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;bias&amp;lt;/code&amp;gt; favors color &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;; &amp;lt;code&amp;gt;css&amp;lt;/code&amp;gt; returns a &amp;lt;code&amp;gt;background-color: …; color: …;&amp;lt;/code&amp;gt; declaration instead.&lt;br /&gt;
&lt;br /&gt;
Lua modules call the same functions with an underscore: &amp;lt;code&amp;gt;_lum(color)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_ratio(args)&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_styleratio(args)&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;_greatercontrast(args)&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!-- Categories below this line --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
[[Category:Module documentation pages]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Speedybrain</name></author>
	</entry>
</feed>