Template:Ink chip: Difference between revisions
Robertbaxter (talk | contribs) No edit summary |
Robertbaxter (talk | contribs) No edit summary |
||
Line 20: | Line 20: | ||
<pre> | <pre> | ||
{{Color chip| | {{Color chip|Huckleberry}} | ||
</pre> | </pre> | ||
{{Color chip| | {{Color chip|Huckleberry}} | ||
</noinclude><includeonly>{{#ifexist:{{{1}}}|<span class="chip color-chip text-{{#ifexpr:{{#rmatch:{{#invoke:Color|hexToCielch|{{#invoke:Color|rgbTripletToHex|{{#rmatch:{{#show: {{{1}}} |? Has rgb#}}|/^([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3})$/|$1|}}|{{#rmatch:{{#show: {{{1}}} |? Has rgb#}}|/^([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3})$/|$2|}}|{{#rmatch:{{#show: {{{1}}} |? Has rgb#}}|/^([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3})$/|$3|}}}}}}|/^([0-9]{1,3})/|$1}}>75|black|white}}" style="background:rgba({{#show: {{{1}}} |? Has rgb#}},1);border-color:rgba({{#show: {{{1}}} |? Has rgb#}},1);">[[{{{link|{{{1|}}}}}}|{{{1|}}}]]</span>|<span class="chip color-chip">[[{{{link|{{{1|}}}}}}|{{{1|}}}]]</span>}}</includeonly> | </noinclude><includeonly>{{#ifexist:{{{1}}}|<span class="chip color-chip text-{{#ifexpr:{{#rmatch:{{#invoke:Color|hexToCielch|{{#invoke:Color|rgbTripletToHex|{{#rmatch:{{#show: {{{1}}} |? Has rgb#}}|/^([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3})$/|$1|}}|{{#rmatch:{{#show: {{{1}}} |? Has rgb#}}|/^([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3})$/|$2|}}|{{#rmatch:{{#show: {{{1}}} |? Has rgb#}}|/^([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3})$/|$3|}}}}}}|/^([0-9]{1,3})/|$1}}>75|black|white}}" style="background:rgba({{#show: {{{1}}} |? Has rgb#}},1);border-color:rgba({{#show: {{{1}}} |? Has rgb#}},1);">[[{{{link|{{{1|}}}}}}|{{{1|}}}]]</span>|<span class="chip color-chip">[[{{{link|{{{1|}}}}}}|{{{1|}}}]]</span>}}</includeonly> |
Revision as of 17:40, 6 December 2024
A template to display ink colors as chips.
Usage
{{Color chip|Violet}}
Advanced attributes
Sometimes you will need the chip to point to a link other than the title, you can use that buy adding the link attribute:
{{Color chip|Yellow|link=Violet}}
Advanced attributes
If a chip is requested for a page that does not exist, it will be shown as a chip but with no color background and a red link.
{{Color chip|Huckleberry}}