Toggle menu
15
236
71
27.6K
Kenshi Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Created page with "{{Documentation subpage}} __NOTOC__ <!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE --> {{high-use}} {{Warning |'''Prose text intended for readers should never be manually colored.''' (MOS:PROSECOLOR)}} {{Uses TemplateStyles|Template:Color/styles.css}} {{tl|color}} can be used to specify the foreground color of a span of text. Acceptable values are RGB hex codes, e.g. #C9E72A, or any of the web colors: red, blue, green, m..."
 
No edit summary
 
Line 1: Line 1:
{{Documentation subpage}} __NOTOC__
<!-- PLEASE ADD CATEGORIES WHERE INDICATED AT THE BOTTOM OF THIS PAGE -->
{{high-use}}
{{Warning |'''Prose text intended for readers should never be manually colored.''' ([[MOS:PROSECOLOR]])}}
{{Uses TemplateStyles|Template:Color/styles.css}}
{{tl|color}} can be used to specify the foreground color of a span of text. Acceptable values are [[RGB color model|RGB]] hex codes, e.g. #C9E72A, or any of the [[web colors]]: red, blue, green, moccasin, darkorchid, etc. To set the background color of a span of text, use {{Template link|background color}}.


== Usage ==
;Description
* {{Template link expanded|color|name of color or hex code of color|Text}}
:This template is used to provide a quick & dirty way of adding pre-defined colors to various elements.
;Syntax
:Type {{t|Color|param1|style=code}} somewhere.
;Sample output
:<code><nowiki>{{</nowiki>Color<nowiki>|Unique}}</nowiki></code> gives...
:{{Color|Unique}}
:{|style="border: solid #black 1px; line-height:1; background: grey; color: black; width: 450px; padding: 0.3em; text-align: left; clear:none;"
! !! !! Css variable
|-
| style="background: #{{Color|Border}}; width: 30px"|<nowiki> </nowiki>
|Border
| style="font-size: 80%;"| --custom-color-template-border
|-
| style="background: #{{Color|Background}}"|<nowiki> </nowiki>
|Background
| style="font-size: 80%;"| --custom-color-template-background
|-
| style="background: #{{Color|Background2}}"|<nowiki> </nowiki>
|Background2
| style="font-size: 80%;"| --custom-color-template-background2
|-
| style="background: #{{Color|DarkText}}"|<nowiki> </nowiki>
|DarkText
| style="font-size: 80%;"| --custom-color-template-darktext
|-
| style="background: #{{Color|GreyText}}"|<nowiki> </nowiki>
|GreyText
| style="font-size: 80%;"| --custom-color-template-greytext
|-
| style="background: #{{Color|GreyText2}}"|<nowiki> </nowiki>
|GreyText2
| style="font-size: 80%;"| --custom-color-template-greytext2
|-
| style="background: #{{Color|RedText}}"|<nowiki> </nowiki>
|RedText
| style="font-size: 80%;"| --custom-color-template-redtext
|-
| style="background: #{{Color|Title}}"|<nowiki> </nowiki>
|Title
| style="font-size: 80%;"| --custom-color-template-title
|-
| style="background: #{{Color|Vendor}}"|<nowiki> </nowiki>
|Vendor
| style="font-size: 80%;"| --custom-color-template-vendor
|-
| style="background: #{{Color|WikiHeader}}"|<nowiki> </nowiki>
|WikiHeader
| style="font-size: 80%;"| --custom-color-template-wikiheader
|-
| style="background: #{{Color|LightText}}"|<nowiki> </nowiki>
|LightText
| style="font-size: 80%;"| --custom-color-template-lighttext
|-
| style="background: #{{Color|White}}"|<nowiki> </nowiki>
|White
| style="font-size: 80%;"| --custom-color-template-white
|-
| style="background: #{{Color|Yellow}}"|<nowiki> </nowiki>
|Yellow
| style="font-size: 80%;"| --custom-color-template-yellow
|-
| style="background: #{{Color|ItemStandard}}"|<nowiki> </nowiki>
|ItemStandard
| style="font-size: 80%;"| --custom-color-template-itemstandard
|-
| style="background: #{{Color|Unique}}"|<nowiki> </nowiki>
|Unique
| style="font-size: 80%;"| --custom-color-template-unique
|-
| style="background: #{{Color|Prototype}}"|<nowiki> </nowiki>
|Prototype
| style="font-size: 80%;"| --custom-color-template-prototype
|-
| style="background: #{{Color|Shoddy}}"|<nowiki> </nowiki>
|Shoddy
| style="font-size: 80%;"| --custom-color-template-shoddy
|-
| style="background: #{{Color|Standard}}"|<nowiki> </nowiki>
|Standard
| style="font-size: 80%;"| --custom-color-template-standard
|-
| style="background: #{{Color|High}}"|<nowiki> </nowiki>
|High
| style="font-size: 80%;"| --custom-color-template-high
|-
| style="background: #{{Color|Specialist}}"|<nowiki> </nowiki>
|Specialist
| style="font-size: 80%;"| --custom-color-template-specialist
|-
| style="background: #{{Color|Masterwork}}"|<nowiki> </nowiki>
|Masterwork
| style="font-size: 80%;"| --custom-color-template-masterwork
|-
|}
;See also:
: [[Template:Grade]]
: [[Template:Grade/Short]]


For example:
;TemplateData
* {{#invoke:demoTemplate|color|red|Hello, world!}}
* {{#invoke:demoTemplate|color|#00F000|Hello, world!}}
 
If the second parameter is omitted, the color value is displayed as text:
* {{#invoke:demoTemplate|color|#00F000}}
* {{#invoke:demoTemplate|color|red}}
 
=== Dark mode ===
This template does not function in dark mode. If you have a use case for color in your page, you should use an existing more-specific template (such as {{tl|increase}} or {{tl|xt}}).
 
== Redirects ==
* {{Template link general |COLOR|nolink=on|code=on}}
* {{Template link general |Colored text|nolink=on|code=on}}
* {{Template link general |Colour|nolink=on|code=on}}
* {{Template link general|COLOUR|nolink=on|code=on}}
* {{Template link general |Fgcolor|nolink=on|code=on}}
 
== See also ==
* {{Template link|resize}}
* {{Template link|colored link}}
* {{Template link|background color}}
* {{Template link|font color}} – allows setting both text and background color
* {{Template link|coltit}} – colored table header cell
* {{Template link|overcoloured}} – when color is used in a way that hides information from color-blind people
 
== TemplateData ==
{{TemplateData header}}
<templatedata>
<templatedata>
{
{
"description": "The color template can be used to add a span of text with any given text color",
  "description": "This template is used to provide a quick & dirty way of adding pre-defined colors to various elements.",
"params": {
  "params": {
"1": {
    "1": {
"label": "Color",
      "label": "Color",
"description": "CSS name of color or hex code of color, e.g. 'red' or '#00F000'.",
      "description": "Pre-defined color's name - chosen from the suggested values.",
"type": "string",
      "required": true,
"required": true
      "type": "line",
},
      "suggestedvalues": [
"2": {
        "Border",
"label": "Text",
        "Background",
"description": "The string of text to be formatted in the desired color",
        "Background2",
"type": "string",
        "DarkText",
"suggested": true
        "GreyText",
}
        "GreyText2",
}
        "Title",
        "RedText",
        "Vendor",
        "WikiHeader",
        "LightText",
        "White",
        "Yellow",
        "ItemStandard",
        "Unique",
        "Prototype",
        "Shoddy",
        "Standard",
        "High",
        "Specialist",
        "Masterwork"
      ]
    }
  },
  "format": "inline"
}
}
</templatedata>
</templatedata>


<includeonly>{{Sandbox other|
<includeonly>
| <!-- CATEGORIES BELOW THIS LINE, PLEASE: -->
<!-- Categories/interwikis for the template -->
[[Category:Text color templates| ]]
[[Category:Templates]]
}}</includeonly>
</includeonly><noinclude>
<!-- Categories/interwikis for this documentation -->
[[Category:Template documentation]]
</noinclude>
 
[[Category:Template documentation pages|Color/doc]]

Latest revision as of 02:29, 14 June 2025

Description
This template is used to provide a quick & dirty way of adding pre-defined colors to various elements.
Syntax
Type {{Color}} somewhere.
Sample output
{{Color|Unique}} gives...
67d1b4
Css variable
style="background: #292929; width: 30px"| Border --custom-color-template-border
style="background: #322d2a"| Background --custom-color-template-background
style="background: #26211e"| Background2 --custom-color-template-background2
style="background: #2e201d"| DarkText --custom-color-template-darktext
style="background: #635e5b"| GreyText --custom-color-template-greytext
style="background: #4c443b"| GreyText2 --custom-color-template-greytext2
style="background: #59231a"| RedText --custom-color-template-redtext
style="background: #492620"| Title --custom-color-template-title
style="background: #746659"| Vendor --custom-color-template-vendor
style="background: #7d7065"| WikiHeader --custom-color-template-wikiheader
style="background: #b0a68b"| LightText --custom-color-template-lighttext
style="background: #C0C0C0"| White --custom-color-template-white
style="background: #b3b282"| Yellow --custom-color-template-yellow
style="background: #e0cccc"| ItemStandard --custom-color-template-itemstandard
style="background: #67d1b4"| Unique --custom-color-template-unique
style="background: #666666"| Prototype --custom-color-template-prototype
style="background: #d9ccbf"| Shoddy --custom-color-template-shoddy
style="background: #4099b3"| Standard --custom-color-template-standard
style="background: #66fc80"| High --custom-color-template-high
style="background: #fceb0d"| Specialist --custom-color-template-specialist
style="background: #fceb0d"| Masterwork --custom-color-template-masterwork
See also
Template:Grade
Template:Grade/Short
TemplateData

This template is used to provide a quick & dirty way of adding pre-defined colors to various elements.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Color1

Pre-defined color's name - chosen from the suggested values.

Suggested values
Border Background Background2 DarkText GreyText GreyText2 Title RedText Vendor WikiHeader LightText White Yellow ItemStandard Unique Prototype Shoddy Standard High Specialist Masterwork
Linerequired