Template:Color: Difference between revisions
Jump to navigation
Jump to search
(The new purpose of the template.) |
mNo edit summary |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly><onlyinclude><span style="white-space:nowrap"><!-- | |||
------ Color Square | |||
--><span style="position:relative; display:inline-block; width:8px; height:8px; margin:0 .3em -1px 0; border:1px solid #525252; background:#FFF"><!-- | |||
--><span style="position:absolute; left:0; top:0; width:4px; height:4px; background:#999"></span><!-- | |||
--><span style="position:absolute; right:0; bottom:0; width:4px; height:4px; background:#999"></span><!-- | |||
--><span style="position:absolute; left:0; top:0; width:8px; height:8px; background:rgb({{{r|{{{rgb|0}}}}}},{{{g|{{{rgb|0}}}}}},{{{b|{{{rgb|0}}}}}},{{{a|1}}})"></span><!-- | |||
--></span><!-- | |||
-- | ------ Arrow Button | ||
-->< | --><span class="mw-customtoggle-color{{{rgb|0}}}{{{r|0}}}{{{g|0}}}{{{b|0}}}{{{a|1}}}" style="margin-right:.3em; user-select:none"><span style="display:inline-block; width:8px; height:10px; margin-bottom:-1px; background:#FFF; clip-path:path('M4,0l4,4H0m0,2H8L4,10')"></span></span><!-- | ||
-- | ------ HEX Format | ||
-->< | --><samp id="mw-customcollapsible-color{{{rgb|0}}}{{{r|0}}}{{{g|0}}}{{{b|0}}}{{{a|1}}}" class="mw-collapsible" style="color:#EEE; user-select:all">#{{#switch:{{#expr:floor({{{r|{{{rgb|0}}}}}} / 16)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}<!-- | ||
|10=A|11=B|12=C|13=D|14=E|15=F | -->{{#switch:{{#expr:{{{r|{{{rgb|0}}}}}} mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}<!-- | ||
}}{{#switch:{{#expr:{{{r| | -->{{#switch:{{#expr:floor({{{g|{{{rgb|0}}}}}} / 16)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}<!-- | ||
|10=A|11=B|12=C|13=D|14=E|15=F | -->{{#switch:{{#expr:{{{g|{{{rgb|0}}}}}} mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}<!-- | ||
}}{{#switch:{{#expr:floor({{{g| | -->{{#switch:{{#expr:floor({{{b|{{{rgb|0}}}}}} / 16)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}<!-- | ||
|10=A|11=B|12=C|13=D|14=E|15=F | -->{{#switch:{{#expr:{{{b|{{{rgb|0}}}}}} mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}<!-- | ||
}}{{#switch:{{#expr:{{{g| | -->{{#if:{{{a|}}}|{{#switch:{{#expr:floor((({{{a}}} * 255) round 0) / 16)}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}<!-- | ||
|10=A|11=B|12=C|13=D|14=E|15=F | -->{{#switch:{{#expr:(({{{a}}} * 255) round 0) mod 16}}|0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=A|11=B|12=C|13=D|14=E|15=F}}}}</samp><!-- | ||
}}{{#switch:{{#expr:floor({{{b| | |||
|10=A|11=B|12=C|13=D|14=E|15=F | |||
}}{{#switch:{{#expr:{{{b| | |||
|10=A|11=B|12=C|13=D|14=E|15=F | |||
}}{{#if:{{{a|}}}|{{#switch:{{#expr:floor((({{{a}}} * 255) round 0) / 16)}}| | |||
|10=A|11=B|12=C|13=D|14=E|15=F | |||
}}{{#switch:{{#expr:(({{{a}}} * 255) round 0) mod 16}}| | |||
|10=A|11=B|12=C|13=D|14=E|15=F | |||
}}}} | |||
-- | ------ RGB Format | ||
-->< | --><samp id="mw-customcollapsible-color{{{rgb|0}}}{{{r|0}}}{{{g|0}}}{{{b|0}}}{{{a|1}}}" class="mw-collapsible mw-collapsed" style="display:none; color:#EEE; user-select:all">rgb({{{r|{{{rgb|0}}}}}},{{{g|{{{rgb|0}}}}}},{{{b|{{{rgb|0}}}}}}{{#if:{{{a|}}}|,{{{a}}}}})</samp><!-- | ||
--> | --></span></onlyinclude></includeonly> | ||
{{Doc}} | |||
[[Category:Mathematics templates]] |
Latest revision as of 05:14, 27 September 2025
The above documentation is transcluded from Template:Color/doc. (Edit | Page history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.