Template:Wikicolor: Difference between revisions
Robertbaxter (talk | contribs) No edit summary |
Robertbaxter (talk | contribs) m (Text replacement - "{{wiki color|" to "{{wikicolor|") |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 24: | Line 24: | ||
== Usage == | == Usage == | ||
The ink name should be provided as the first parameter. An optional second parameter provides the alpha/lightness value for the color, and should be used only as 0.1 or 0.2 (or the default of 1). | The ink name should be provided as the first parameter. An optional second parameter provides the alpha/lightness value for the color, and should be used only as 0.1 or 0.2 (or the default of 1). | ||
<pre>{{ | <pre>{{wikicolor|Sunflower}} | ||
{{ | {{wikicolor|Light Teal}} | ||
{{ | {{wikicolor|Orchid|0.2}}</pre> | ||
<code>{{ | <code>{{wikicolor|Sunflower}} | ||
{{ | {{wikicolor|Light Teal}} | ||
{{ | {{wikicolor|Orchid|0.2}}</code> | ||
== TemplateData == | == TemplateData == | ||
| Line 65: | Line 65: | ||
} | } | ||
</templatedata> | </templatedata> | ||
{{DISPLAYTITLE:Template: | {{DISPLAYTITLE:Template:wikicolor}}</noinclude><includeonly><!-- | ||
-->{{#switch:{{lc:{{{1}}}}} | -->{{#switch:{{lc:{{{1}}}}} | ||
| sunflower = rgba(255, 181, 17, {{{2|1}}}) | | sunflower = rgba(255, 181, 17, {{{2|1}}}) | ||
| Line 74: | Line 74: | ||
| orchid = rgba(187, 118, 207, {{{2|1}}}) | | orchid = rgba(187, 118, 207, {{{2|1}}}) | ||
| light gray = rgba(184, 194, 204, {{{2|1}}}) | | light gray = rgba(184, 194, 204, {{{2|1}}}) | ||
| #default = rgba(0, 0, 0, | | #default = rgba(0, 0, 0, 1) | ||
}}<!-- | }}<!-- | ||
--><nowiki/></includeonly> | --><nowiki/></includeonly> | ||
Latest revision as of 13:20, 30 November 2025
This template generates a rgba() format color code (for use in style CSS attributes) based on named ink colors. The color palette of this wiki is based on riso ink colors for Sunflower Blue Light Teal Red Kelly Green Orchid Light Gray—this template provides a quick way to embed those color codes.
| Color | R | G | B |
|---|---|---|---|
| Sunflower | 255 |
181 |
17
|
| Blue | 0 |
120 |
191
|
| Light Teal | 0 |
157 |
165
|
| Red | 255 |
102 |
94
|
| Kelly Green | 103 |
179 |
70
|
| Orchid | 187 |
118 |
207
|
| Light Gray | 184 |
194 |
204
|
These are static values, not semantic queries, to reduce the queries needed for basic site functionality.
Usage
The ink name should be provided as the first parameter. An optional second parameter provides the alpha/lightness value for the color, and should be used only as 0.1 or 0.2 (or the default of 1).
{{wikicolor|Sunflower}}
{{wikicolor|Light Teal}}
{{wikicolor|Orchid|0.2}}
rgba(255, 181, 17, 1)
rgba(0, 157, 165, 1)
rgba(187, 118, 207, 0.2)
TemplateData
A CSS color code from key ink colors used in styles throughout the site.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Color name | 1 | The ink color name.
| String | required |
| Alpha | 2 | Percentage alpha (0–100), to produce lighter versions of each color
| Number | optional |