Difference between revisions of "Template:Colored list/doc"

From blackwiki
Jump to navigation Jump to search
imported>Ahecht
(→‎Color sequences: Switch attribution to colorbrewer, sort by length and then title)
imported>Ahecht
(→‎Color sequences: alphebatize)
Line 39: Line 39:
 
===Color sequences===
 
===Color sequences===
 
The following color sequences are available, mostly taken from the [https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md D3 3.x API] and [https://github.com/axismaps/colorbrewer/blob/master/cb.csv colorbrewer]:
 
The following color sequences are available, mostly taken from the [https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md D3 3.x API] and [https://github.com/axismaps/colorbrewer/blob/master/cb.csv colorbrewer]:
 +
<code>[https://github.com/axismaps/colorbrewer/blob/master/cb.csv accent]</code>: {{Colored list|1|2|3|4|5|6|7|8|class=hlist|s=accent}}
 
<code>[[LibreOffice Calc|calc]]</code>: {{Colored list|1|2|3|4|5|6|7|8|class=hlist|s=calc}}
 
<code>[[LibreOffice Calc|calc]]</code>: {{Colored list|1|2|3|4|5|6|7|8|class=hlist|s=calc}}
 
<code>[[Microsoft Excel|excel]]</code>: {{Colored list|1|2|3|4|5|6|7|8|class=hlist|s=excel}}
 
<code>[[Microsoft Excel|excel]]</code>: {{Colored list|1|2|3|4|5|6|7|8|class=hlist|s=excel}}
<code>[https://github.com/axismaps/colorbrewer/blob/master/cb.csv accent]</code>: {{Colored list|1|2|3|4|5|6|7|8|class=hlist|s=accent}}
 
 
<code>[https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md#category10 category10]</code> or <code>category</code>: {{Colored list|1|2|3|4|5|6|7|8|9|10|class=hlist|s=category10}}
 
<code>[https://github.com/d3/d3-3.x-api-reference/blob/master/Ordinal-Scales.md#category10 category10]</code> or <code>category</code>: {{Colored list|1|2|3|4|5|6|7|8|9|10|class=hlist|s=category10}}
 
<code>[https://github.com/axismaps/colorbrewer/blob/master/cb.csv dark2]</code> or <code>dark</code>: {{Colored list|1|2|3|4|5|6|7|8|class=hlist|s=dark2}}
 
<code>[https://github.com/axismaps/colorbrewer/blob/master/cb.csv dark2]</code> or <code>dark</code>: {{Colored list|1|2|3|4|5|6|7|8|class=hlist|s=dark2}}

Revision as of 22:20, 28 April 2020

Creates a list where each item is colored with a contrasting color, e.g.:

Usage

{{Colored list|list items|pre=item prefix|tag=HTML tag for each item|style=CSS|class="list class"|sep="item separator"|s='color sequence (see below)'}}

All named parameters are optional, and default to:

pre    = * (bulleted list)
tag    = span
style  = (none)
class  = (none)
sep    = \n (new line)
s      = category10
Input Output
{{Colored list|One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten}}
  • Seven
  • One
  • Two
  • Four
  • Eight
  • Nine
  • Five
  • Ten
  • Three
  • Six
{{Colored list|One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten|pre=#}}
  1. Seven
  2. One
  3. Two
  4. Four
  5. Eight
  6. Nine
  7. Five
  8. Ten
  9. Three
  10. Six
{{Colored list|One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten|pre=|tag=i|style=font-weight: bold|sep=;}} Seven;One;Two;Four;Eight;Nine;Five;Ten;Three;Six
{{Colored list|One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten|class=hlist}}
  • Seven
  • One
  • Two
  • Four
  • Eight
  • Nine
  • Five
  • Ten
  • Three
  • Six
{{Colored list|One|Two|class=plainlist}}
  • One
  • Two
{{Colored list|1=1+1=2|2=2+2=4}} -or-
{{Colored list|1+1{{=}}2|2+2{{=}}4}}
  • 1+1=2
  • 2+2=4

Color sequences

The following color sequences are available, mostly taken from the D3 3.x API and colorbrewer:

accent:

  • 7
  • 1
  • 2
  • 4
  • 8
  • 5
  • 3
  • 6

calc:

  • 7
  • 1
  • 2
  • 4
  • 8
  • 5
  • 3
  • 6

excel:

  • 7
  • 1
  • 2
  • 4
  • 8
  • 5
  • 3
  • 6

category10 or category:

  • 7
  • 1
  • 2
  • 4
  • 8
  • 9
  • 5
  • 10
  • 3
  • 6

dark2 or dark:

  • 7
  • 1
  • 2
  • 4
  • 8
  • 5
  • 3
  • 6

set1 or set:

  • 7
  • 1
  • 2
  • 4
  • 8
  • 9
  • 5
  • 3
  • 6

tableau10 or tableau:

  • 7
  • 1
  • 2
  • 4
  • 8
  • 9
  • 5
  • 10
  • 3
  • 6

google:

  • 7
  • 1
  • 2
  • 4
  • 8
  • 9
  • 5
  • 10
  • 3
  • 6
  • 12
  • 11

category20:

  • 1
  • 2
  • 4
  • 8
  • 16
  • 17
  • 9
  • 18
  • 5
  • 10
  • 20
  • 11
  • 3
  • 6
  • 12
  • 13
  • 7
  • 14
  • 19
  • 15

category20b:

  • 1
  • 2
  • 4
  • 8
  • 16
  • 17
  • 9
  • 18
  • 5
  • 10
  • 20
  • 11
  • 3
  • 6
  • 12
  • 13
  • 7
  • 14
  • 19
  • 15

category20c:

  • 1
  • 2
  • 4
  • 8
  • 16
  • 17
  • 9
  • 18
  • 5
  • 10
  • 20
  • 11
  • 3
  • 6
  • 12
  • 13
  • 7
  • 14
  • 19
  • 15

See also