Difference between revisions of "Template:Colort/Color"
Jump to navigation
Jump to search
Template documentation
imported>Crissov ({{{sort}}}) |
(doc) |
||
| Line 3: | Line 3: | ||
</noinclude> | </noinclude> | ||
|- | |- | ||
| − | !style="border-left-width:4em;border-left-color:rgb({{{r}}},{{{g}}},{{{b}}});text-align:left; font-weight:normal"| {{#if:{{{sort|}}}|{{sort|{{{sort}}}|{{{name}}} }}|{{{name}}} }} | + | !style="border-left-width:4em;border-left-color:rgb({{{r|0}}},{{{g|0}}},{{{b|0}}});text-align:left; font-weight:normal"| {{#if:{{{sort|}}}|{{sort|{{{sort}}}|{{{name}}} }}|{{{name}}} }} |
| − | |style="border-left-width:2px;border-right-width:1px;font-family:monospace;"| #{{{hex|{{hex3|{{{r}}}|{{{g}}}|{{{b}}}|#=}} }}} | + | |style="border-left-width:2px;border-right-width:1px;font-family:monospace;"| #{{{hex|{{hex3|{{{r|0}}}|{{{g|0}}}|{{{b|0}}}|#=}} }}} |
| − | |style="border-left-width:1px;border-right-width:0px;text-align:right;" title="{{{r}}}/255"| {{#expr:{{{r}}}/2.55 round 0}}% | + | |style="border-left-width:1px;border-right-width:0px;text-align:right;" title="{{{r|0}}}/255"| {{#expr:{{{r|0}}}/2.55 round 0}}% |
| − | |style="border-left-width:0px;border-right-width:0px;text-align:right;" title="{{{g}}}/255"| {{#expr:{{{g}}}/2.55 round 0}}% | + | |style="border-left-width:0px;border-right-width:0px;text-align:right;" title="{{{g|0}}}/255"| {{#expr:{{{g|0}}}/2.55 round 0}}% |
| − | |style="border-left-width:0px;border-right-width:2px;text-align:right;" title="{{{b}}}/255"| {{#expr:{{{b}}}/2.55 round 0}}% | + | |style="border-left-width:0px;border-right-width:2px;text-align:right;" title="{{{b|0}}}/255"| {{#expr:{{{b|0}}}/2.55 round 0}}% |
| − | |style="border-left-width:2px;border-right-width:1px;text-align:right;"| {{Nts|{{{h|{{#expr:{{RGBtoHSL.H|{{{r}}}|{{{g}}}|{{{b}}}|}} round 0}} }}}|}}° | + | |style="border-left-width:2px;border-right-width:1px;text-align:right;"| {{Nts|{{{h|{{#expr:{{RGBtoHSL.H|{{{r|0}}}|{{{g|0}}}|{{{b|0}}}|}} round 0}} }}}|}}° |
| − | |style="border-left-width:1px;border-right-width:0px;text-align:right;"| {{#expr:100*{{RGBtoHSL.S|{{{r}}}|{{{g}}}|{{{b}}}|}} round 0}}% | + | |style="border-left-width:1px;border-right-width:0px;text-align:right;"| {{#expr:100*{{RGBtoHSL.S|{{{r|0}}}|{{{g|0}}}|{{{b|0}}}|}} round 0}}% |
| − | |style="border-left-width:0px;border-right-width:1px;text-align:right;"| {{#expr:100*{{RGBtoHSL.L|{{{r}}}|{{{g}}}|{{{b}}}|}} round 0}}% | + | |style="border-left-width:0px;border-right-width:1px;text-align:right;"| {{#expr:100*{{RGBtoHSL.L|{{{r|0}}}|{{{g|0}}}|{{{b|0}}}|}} round 0}}% |
|style="border-left-width:1px;border-right-width:0px;text-align:right;"| {{{s|—}}}% | |style="border-left-width:1px;border-right-width:0px;text-align:right;"| {{{s|—}}}% | ||
|style="border-left-width:0px;border-right-width:2px;text-align:right;"| {{{v|—}}}% {{#if:{{{html_name|}}}| | |style="border-left-width:0px;border-right-width:2px;text-align:right;"| {{{v|—}}}% {{#if:{{{html_name|}}}| | ||
{{!}}{{!}}style="border-left-width:2px;"{{!}} {{{html_name}}} }}<noinclude> | {{!}}{{!}}style="border-left-width:2px;"{{!}} {{{html_name}}} }}<noinclude> | ||
|} | |} | ||
| − | + | {{documentation | |
| + | |content = | ||
| + | === Usage === | ||
| + | <pre style="overflow:auto"> | ||
| + | {{Colort/Color | ||
| + | |r = 'red value' | ||
| + | |g = 'green value' | ||
| + | |b = 'blue value' | ||
| + | |name = 'common name' | ||
| + | |html_name = 'html name' | ||
| + | |h = 'hue' | ||
| + | |s = 'saturation percent' | ||
| + | |v = 'brightness percent' | ||
| + | }} | ||
| + | </pre> | ||
If not provided, HSL and [[hex triplet]] are auto-generated from ''r'', ''g'' and ''b'' parameters. There are no [[:Category:Color conversion templates|color conversion templates]] for HSV or other notations yet (hue is the same as HSL). | If not provided, HSL and [[hex triplet]] are auto-generated from ''r'', ''g'' and ''b'' parameters. There are no [[:Category:Color conversion templates|color conversion templates]] for HSV or other notations yet (hue is the same as HSL). | ||
[[ar:قالب:Color/Color]] | [[ar:قالب:Color/Color]] | ||
| + | }} | ||
</noinclude> | </noinclude> | ||
Revision as of 18:51, 22 December 2010
| Name | Hex (RGB) |
Red (RGB) |
Green (RGB) |
Blue (RGB) |
Hue (HSL/HSV) |
Satur. (HSL) |
Light (HSL) |
Satur. (HSV) |
Value (HSV) |
|---|---|---|---|---|---|---|---|---|---|
| {{{name}}} | #000000 | 0% | 0% | 0% | Template:Nts° | Expression error: Unrecognized punctuation character "[".% | Expression error: Unrecognized punctuation character "[".% | —% | —% |
Usage
{{Colort/Color
|r = 'red value'
|g = 'green value'
|b = 'blue value'
|name = 'common name'
|html_name = 'html name'
|h = 'hue'
|s = 'saturation percent'
|v = 'brightness percent'
}}
If not provided, HSL and hex triplet are auto-generated from r, g and b parameters. There are no color conversion templates for HSV or other notations yet (hue is the same as HSL).
| The above documentation is transcluded from Template:Colort/Color/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Subpages of this template. |