Help:Creating Color Charts

From WikiKnitting.com

Jump to: navigation, search

Contents

[edit] Introduction

This page explains how to easily add a color chard for fair isle, intarsia or other motif styles to your pattern page.

[edit] How to Setup a Color Chart

Creating a color chart for fair isle, intarsia or other color work is very simple and straight forward. This method is much simpler then using a wiki table and is the recommended method for WikiKnitting.com.

[edit] Basic Syntax


The text in the box below creates the above table.

<colorchart>
w=white,l=lightblue:
wlwlwlw;
lwlwlwl;
wwwwwww;
lllllll;
wwwwwww;
lwlwlwl;
wlwlwlw;
</colorchart>

The table needs to be enclosed in the wiki tags.

<colorchart></colorchart>

The first row creates the association between the desired HTML color and a single letter designator. Both HTML color names and hexadecimal codes can be used. The list must be comma separated and must end in a colon ":" There is no limit to the number of colors that can be defined in the list.

w=white,l=lightblue:

The remaining rows are used to create the color table using the single letter color designators assigned in the first row. The table will be drawn based on these letters. Ex: aaaa; gives a 4 column table. Every row of letters will add a row to the table. Each row must end in a semi-colon ";" There is no limit on the number of rows or columns that can be used in the table.

lwlwlwl;

[edit] Advanced Options

There are a few optional arguments that will allow you to customize the look of the chart. These arguments can be used individually or combined.

[edit] Title

A title can be added by including the title argument shown below.

<colorchart title="Color Chart">
w=white,l=lightblue:
wlw;
lwl;
</colorchart>

Color Chart

[edit] Cell Width and Height

A width and height of the cells can be adjusted by including the width and height arguments as shown below. The arguments can be used individually or together.

<colorchart width=50 height=50>
w=white,l=lightblue:
wlw;
lwl;
</colorchart>

[edit] Include Cell Text

The single color designators can be shown in the associated cells by setting the text argument to true as shown below.

<colorchart text=true>
w=white,l=lightblue:
wlw;
lwl;
</colorchart>

wlw
lwl

[edit] Row and Column Numbers

Both row and column numbers can be added to the chart by including the grid argument shown below.

Note: If the grid argument is true, the minimum cell height and width that can be displayed is 20x20.

<colorchart grid=true>
w=white,l=lightblue:
wlw;
lwl;
wlw;
</colorchart>

3
2
1
321

[edit] Adding a Color Legend

A color legend can be added to a page using the text below. It will only show the rows that you have filled in the information for.

ColorYarnNo. of Skeins
Color A Sandnes Mandarin Petit1
Color B Sandnes Mandarin Petit
{{Color Legend
|color a=lightblue
|color a yarn=Sandnes Mandarin Petit 
|color a skeins=1
|color b=white
|color b yarn=[[Sandnes Mandarin Petit]]
|color b skeins=
|color c=
|color c yarn=Sandnes Mandarin Petit blue
|color c skeins=3
|color d=
|color d yarn=
|color d skeins=
|color e=
|color e yarn=
|color e skeins=
|color f=
|color f yarn=
|color f skeins=
|color g=
|color g yarn=
|color g skeins=
|color h=
|color h yarn=
|color h skeins=
|color i=
|color i yarn=
|color i skeins=
|color j=
|color j yarn=
|color j skeins=
}}
  • Fill out the information for the colors used. Any color that does not have text after the "=", will be ignored.
    • color a= This is the html color name or color code for a color
    • color a yarn= Enter the brand name and type of yarn used.
    • color a skeins=The number of skeins or balls of yarn required for the project
  • The Color legend supports up to 10 colors.
  • Both HTML color names and color codes can be used.
  • Wikitext formatting can be used in the yarn and skein lines.
  • Unused color lines can be deleted with no ill effect.
{{Color Legend
|color a=lightblue
|color a yarn=Sandnes Mandarin Petit 
|color a skeins=1
|color b=white
|color b yarn=[[Sandnes Mandarin Petit]]
|color b skeins=3
}}
ColorYarnNo. of Skeins
Color A Sandnes Mandarin Petit1
Color B Sandnes Mandarin Petit 3

[edit] External Links

Color Codes on metawikimedia - http://meta.wikimedia.org/wiki/WIKI_COLOR_FORMATTING_HELP

Personal tools
Advertisement