Difference between revisions of "Template:Colort/Color"

From blackwiki
Jump to navigation Jump to search
imported>Crissov
m (Undid revision 438028015 by 98.210.210.193 (talk))
imported>Crissov
m (border-style)
Line 3: Line 3:
 
</noinclude>
 
</noinclude>
 
|-
 
|-
!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:solid 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|0}}}|{{{g|0}}}|{{{b|0}}}|#=}} }}}
+
|style="border-left:solid 2px;border-right:solid 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|0}}}/255"| {{#expr:{{{r|0}}}/2.55 round 0}}%  
+
|style="border-left:solid 1px;border-right:solid 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|0}}}/255"| {{#expr:{{{g|0}}}/2.55 round 0}}%
+
|style="border-left:solid 0px;border-right:solid 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|0}}}/255"| {{#expr:{{{b|0}}}/2.55 round 0}}%
+
|style="border-left:solid 0px;border-right:solid 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;"| {{#ifeq:{{{h}}}|—|—|{{Nts|{{{h|{{#expr:{{RGBtoHSL.H|{{{r|0}}}|{{{g|0}}}|{{{b|0}}}|}} round 0}} }}}|}}°}}
+
|style="border-left:solid 2px;border-right:solid 1px;text-align:right;"| {{#ifeq:{{{h}}}|—|—|{{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|0}}}|{{{g|0}}}|{{{b|0}}}|}} round 0}}%  
+
|style="border-left:solid 1px;border-right:solid 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|0}}}|{{{g|0}}}|{{{b|0}}}|}} round 0}}%  
+
|style="border-left:solid 0px;border-right:solid 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:solid 1px;border-right:solid 0px;text-align:right;"| {{{s|—}}}%  
|style="border-left-width:0px;border-right-width:2px;text-align:right;"| {{{v|—}}}% {{#if:{{{html_name|}}}|
+
|style="border-left:solid 0px;border-right:solid 2px;text-align:right;"| {{{v|—}}}% {{#if:{{{html_name|}}}|
{{!}}{{!}}style="border-left-width:2px;"{{!}} {{{html_name}}} }}<noinclude>
+
{{!}}{{!}}style="border-left:solid 2px;"{{!}} {{{html_name}}} }}<noinclude>
 
|}
 
|}
 
{{documentation
 
{{documentation

Revision as of 18:06, 2 December 2011

Colors
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 "[".% —% —%
Template documentation

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

Usage

{{Colort/Color
|name = 'common name'
|html_name = 'html name'

|r = 'red value'
|g = 'green value'
|b = 'blue value'

|s = 'saturation percent'
|v = 'brightness percent'

|hex = 'Hex triplet' (can be automatically generated from (r,g,b) values)
|h = 'HSL' (hue, can be automatically generated from (r,g,b) values)
}}

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).

Examples

See X11 color names, Web colors, or "what links here". ar:قالب:Color/Color