Template:Ink chip: Difference between revisions

From stencil.wiki
No edit summary
No edit summary
Line 27: Line 27:


<includeonly>
<includeonly>
{{#rmatch:
{{#invoke:Color|hexToCielch|
{{#invoke:Color|hexToHsl|
{{#invoke:Color|rgbTripletToHex|
{{#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})$/|$1|}}
Line 35: Line 34:
}}
}}
}}
}}
|/([0-9]{1,3})%$/|$1}}
<span class="chip color-chip text-{{#ifexpr:
<span class="chip color-chip text-{{#ifexpr:
{{#rmatch:
{{#rmatch:
{{#invoke:Color|hexToHsl|
{{#invoke:Color|hexToCielch|
{{#invoke:Color|rgbTripletToHex|
{{#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})$/|$1|}}

Revision as of 20:00, 3 December 2024

A template to display ink colors as chips.

Usage

{{Color chip|Violet}}

Template:Color chip

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}}

Template:Color chip

TEST

Template:Color chip Template:Color chip Template:Color chip Template:Color chip Template:Color chip