Difference between revisions of "Template:BrewerColorLegends/doc"
imported>Andrybak (use Template:Sandbox other) |
imported>4nn1l2 |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 12: | Line 12: | ||
Valid names and full color representation for each palette. Moving the mouse cursor over each box the color number appears. | Valid names and full color representation for each palette. Moving the mouse cursor over each box the color number appears. | ||
{{center|'''Sequential''' (1-9)}} | {{center|'''Sequential''' (1-9)}} | ||
− | {{ | + | {{div col|colwidth=20em}} |
*YlGn<br>{{BrewerColors|YlGn|9}} | *YlGn<br>{{BrewerColors|YlGn|9}} | ||
*YlGnBu<br>{{BrewerColors|YlGnBu|9}} | *YlGnBu<br>{{BrewerColors|YlGnBu|9}} | ||
Line 31: | Line 31: | ||
*Reds<br>{{BrewerColors|Reds|9}} | *Reds<br>{{BrewerColors|Reds|9}} | ||
*Greys<br>{{BrewerColors|Greys|9}} | *Greys<br>{{BrewerColors|Greys|9}} | ||
− | {{ | + | {{div col end}} |
{{center|'''Divergent''' (1-11)}} | {{center|'''Divergent''' (1-11)}} | ||
− | {{ | + | {{div col|colwidth=20em}} |
*PuOr<br>{{BrewerColors|PuOr|11}} | *PuOr<br>{{BrewerColors|PuOr|11}} | ||
*BrBG<br>{{BrewerColors|BrBG|11}} | *BrBG<br>{{BrewerColors|BrBG|11}} | ||
Line 43: | Line 43: | ||
*Spectral<br>{{BrewerColors|Spectral|11}} | *Spectral<br>{{BrewerColors|Spectral|11}} | ||
*RdYlGn<br>{{BrewerColors|RdYlGn|11}} | *RdYlGn<br>{{BrewerColors|RdYlGn|11}} | ||
− | {{ | + | {{div col end}} |
{{center|'''Qualitative''' (1-8/12)}} | {{center|'''Qualitative''' (1-8/12)}} | ||
− | {{ | + | {{div col|colwidth=20em}} |
*Accent<br>{{BrewerColors|Accent|8}} | *Accent<br>{{BrewerColors|Accent|8}} | ||
*Dark2<br>{{BrewerColors|Dark2|8}} | *Dark2<br>{{BrewerColors|Dark2|8}} | ||
Line 54: | Line 54: | ||
*Set2<br>{{BrewerColors|Set2|8}} | *Set2<br>{{BrewerColors|Set2|8}} | ||
*Set3<br>{{BrewerColors|Set3|12}} | *Set3<br>{{BrewerColors|Set3|12}} | ||
− | {{ | + | {{div col end}} |
== Template data == | == Template data == |
Latest revision as of 08:10, 22 October 2020
![]() | This template uses Lua: |
This template shows the Brewer colors with {{legend}} to include in the code. Based on specifications and designs developed by Cynthia Brewer ([1]).
To translate or review the translation of the module to your language, edit carefully Data:I18n/BrewerColorLegends.tab.
Contents
Syntax
{{BrewerColorLegends|color palette|color number|column width|..}}
The color number must be 3 to 8-12, depending on the color palette:
Brewer's color palettes
Valid names and full color representation for each palette. Moving the mouse cursor over each box the color number appears.
- YlGn
- YlGnBu
- GnBu
- BuGn
- PuBuGn
- PuBu
- BuPu
- RdPu
- PuRd
- OrRd
- YlOrRd
- YlOrBr
- Purples
- Blues
- Greens
- Oranges
- Reds
- Greys
- PuOr
- BrBG
- PRGn
- PiYG
- RdBu
- RdGy
- RdYlBu
- Spectral
- RdYlGn
- Accent
- Dark2
- Paired
- Pastel1
- Pastel2
- Set1
- Set2
- Set3
Template data
TemplateData for BrewerColorLegends
Display a Brewer's color palette
Parameter | Description | Type | Status | |
---|---|---|---|---|
Palette | 1 | Name of the color palette to use | Line | required |
Color number | 2 | Color number required from 3 to 9/12 | Number | required |
Column width | 3 | Width of columns showing colors (and text). Leave blank for no columns | Line | required |
Legend 1 | 4 | Text for the 1st color | Line | optional |
Legend 2 | 5 | Text for the 2nd color | Line | optional |
Legend 3 | 6 | Text for the 3rd color | Line | optional |
Legend 4 | 7 | Text for the 4th color | Line | optional |
Legend 5 | 8 | Text for the 5th color | Line | optional |
Legend 6 | 9 | Text for the 6th color | Line | optional |
Legend 7 | 10 | Text for the 7th color | Line | optional |
Legend 8 | 11 | Text for the 8th color | Line | optional |
Legend 9 | 12 | Text for the 9th color | Line | optional |
Legend 10 | 13 | Text for the 10th color | Line | optional |
Legend 11 | 14 | Text for the 11th color | Line | optional |
Legend 12 | 15 | Text for the 12th color | Line | optional |
Examples
With legend text
{{BrewerColorLegends|Oranges|4|30em|One|Two|Three|Four}}
produces:
{{div col|colwidth=30em}} {{legend|#feedde|One}} {{legend|#fdbe85|Two}} {{legend|#fd8d3c|Three}} {{legend|#d94701|Four}} {{div col end}}
Without legend text
{{BrewerColorLegends|Set3|10|20em}}
produces:
{{div col|colwidth=20em}} {{legend|#8dd3c7|}} {{legend|#ffffb3|}} {{legend|#bebada|}} {{legend|#fb8072|}} {{legend|#80b1d3|}} {{legend|#fdb462|}} {{legend|#b3de69|}} {{legend|#fccde5|}} {{legend|#d9d9d9|}} {{legend|#bc80bd|}} {{div col end}}
See also
- {{BrewerColors}}
- {{ChartColorLegends}}