Template:Color/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎Parameters and Examples: "a" always means alpha channel)
No edit summary
 
Line 2: Line 2:


== Usage ==
== Usage ==
 
You can click on the arrow icon to change the color display from HEX to RGB and back.
=== Parameters and Examples ===
{| class="standard-table" | style="text-align:center"
{| class="standard-table" | style="width:1024px; text-align:center;"
|-
|-
! Parameter
! Parameter
Line 11: Line 10:
! Preview
! Preview
|-
|-
|No parameters  
| No parameters
|Template will revert to the default values if not specified within the parser functions.
| If no parameters are specified, the template will display black color.
|{{Code|<nowiki>{{Color}}</nowiki>}}
| {{Code|{{T|Color}}}}
|{{Color}}
| {{Color}}
|-
|-
|{{Code|<nowiki>{{r|g|b}}</nowiki>}}
| {{Code|{{P| r | <0-255>}}}}<br>{{Code|{{P| g | <0-255>}}}}<br>{{Code|{{P| b | <0-255>}}}}
|Setting the values for r,g,b will give you a specified color.
| Setting the values ​​of red, green and blue colors respectively.
|{{Code|<nowiki>{{Color|r=200|g=128|b=64}}</nowiki>}}
| {{Code|{{T|Color|{{P|r|200}}{{P|g|128}}{{P|b|64}}}}}}
|{{Color|r=200|g=128|b=64}}
| {{Color|r=200|g=128|b=64}}
|-
|-
|{{Code|<nowiki>{{rgb}}</nowiki>}}
| {{Code|{{P| rgb | <0-255>}}}}
|Controls the r,g,b function, if set to 255 the color code will show '''#FFFFFF'''
| Controls all three colors at once. If a separate color value is specified, it will take precedence.
|{{Code|<nowiki>{{Color|rgb=100}}</nowiki>}}<br>{{Code|<nowiki>{{Color|rgb=100|a=.1}}</nowiki>}}
| {{Code|{{T|Color|{{P|rgb|99}}}}}}<br>{{Code|{{T|Color|{{P|rgb|64}}{{P|g|255}}}}}}
|{{Color|rgb=100}}<br>{{Color|rgb=100|a=.1}}
| {{Color|rgb=99}}<br>{{Color|rgb=64|g=255}}
|-
|-
|{{Code|<nowiki>{{a}}</nowiki>}}
| {{Code|{{P| a | <0.0-1.0>}}}}
|Alpha channel
| Alpha channel.
|{{Code|<nowiki>{{Color|rgb=255|a=1}}</nowiki>}}<br>{{Code|<nowiki>{{Color|rgb=255|a=.6}}</nowiki>}}
| {{Code|{{T|Color|{{P|rgb|80}}{{P|b|220}}{{P|a|.6}}}}}}
|{{Color|r=255|g=255|b=255|a=1}}<br>{{Color|r=255|g=255|b=255|a=.6}}
| {{Color|rgb=80|b=220|a=.6}}
|}
|}
{{Bug|hidetested=1|If the same color is specified on the page, then pressing the arrow button will change the HEX/RGB display for all the same colors at once: {{Color|rgb=128}} and {{Color|rgb=128}}.}}
<includeonly>[[Category:Notice templates|{{PAGENAME}}]]</includeonly>
<includeonly>[[Category:Notice templates|{{PAGENAME}}]]</includeonly>

Latest revision as of 05:23, 27 September 2025

Edit-copy.png
This is a documentation subpage for Template:Color.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

Usage

You can click on the arrow icon to change the color display from HEX to RGB and back.

Parameter Description Example Preview
No parameters If no parameters are specified, the template will display black color. {{Color}} #000000
| r = <0-255>
| g = <0-255>
| b = <0-255>
Setting the values ​​of red, green and blue colors respectively. {{Color|r=200|g=128|b=64}} #C88040
| rgb = <0-255> Controls all three colors at once. If a separate color value is specified, it will take precedence. {{Color|rgb=99}}
{{Color|rgb=64|g=255}}
#636363
#40FF40
| a = <0.0-1.0> Alpha channel. {{Color|rgb=80|b=220|a=.6}} #5050DC99
Icon-Bug.pngBug:If the same color is specified on the page, then pressing the arrow button will change the HEX/RGB display for all the same colors at once: #808080 and #808080.