模块:Color contrast/doc
来自戏曲百科
这是模块:Color contrast的文档页面
文件:Template-protection-shackle-picture-1.svg | 此Moduledocumentation已被保护。此为高度可见Moduledocumentation,其已用于大量条目或被频繁替换引用。由于破坏或失误会影响诸多页面,即便细小的改动也可能导致大量服务器负载,因此已被保护,不可编辑。 |
文件:Ambox warning orange.svg | 此Module被引用於約326,000個頁面。 為了避免造成大規模的影響,所有對此Module的編輯應先於沙盒或測試樣例上測試。 測試後無誤的版本可以一次性地加入此Module中,但是修改前請務必於討論頁發起討論。 模板引用數量會自動更新。 |
🪧 | 此-{zh-hans:模块; zh-hant:模組;}-使用Lua语言: |
This module is used primarily by
- {{Color contrast ratio}}
- {{ColorToLum}} / {{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
Usage
To use this module, you may use one of the above listed templates or invoke the module directly
To compute relative luminescence
{{ColorToLum|color}}
or{{#invoke:Color contrast|lum|color}}
To compute a contrast ratio between two colors
{{Color contrast ratio|color1|color2|error=?}}
or{{#invoke:Color contrast|ratio|color1|color2|error=?}}
To determine which of two colors (color2a and color2b) has the greater contrast ratio with a particular color (color1)
{{Greater color contrast ratio|color1|color2a|color2b}}
or{{#invoke:Color contrast|greatercontrast|color1|color2a|color2b}}
To compute the contrast ratio between the background and text colors specified in a css style string
{{#invoke:Color contrast|styleratio|css style statement string|default background color|default text color}}