Add California tartan

This commit is contained in:
Neale Pickett 2015-03-22 23:51:26 +00:00
parent 41d11bd9ff
commit 50b59fd012
3 changed files with 16 additions and 2 deletions

View File

@ -4,13 +4,14 @@ Header: <script src="presets.js"></script>
<canvas id="loom" width="800" height="600" style="width: 100%;"> <canvas id="loom" width="800" height="600" style="width: 100%;">
Sorry, you need HTML5 and JavaScript for this. Sorry, you need HTML5 and JavaScript for this.
<img src="nmloe.png">
</canvas> </canvas>
<div> <div>
<select id="preset"><option disabled>Presets:</option></select> <select id="preset"><option disabled>Presets:</option></select>
<input id="sett" size="30"> <input id="sett" size="30">
<span style="white-space: nowrap;"> <span style="white-space: nowrap;">
Zoom: <select id="thick"><option>1</option><option selected>2</option></select> Zoom: <select id="thick"><option>0.8</option><option>1</option><option selected>2</option></select>
</span> </span>
</div> </div>

View File

@ -19,6 +19,10 @@ var tartans = {
"sett": "Y8 BK2 Y8 BK2 B6 BK2 G8 B4 G8 BK2 B6 BK2 LR10 W2 LR10 BK2 B6 BK2 .", "sett": "Y8 BK2 Y8 BK2 B6 BK2 G8 B4 G8 BK2 B6 BK2 LR10 W2 LR10 BK2 B6 BK2 .",
"description": "I typed in this one as an example of an asymmetric sett." "description": "I typed in this one as an example of an asymmetric sett."
}, },
"California": {
"sett": "Y8 K2 G20 R4 G20 R8 G20 K32 B56 K2 LB8 K2 B56 K32 G20 R4 G20 K2 Y8",
"description": "Contributed by the illustrious Sam Phillips"
},
"Colorado": { "Colorado": {
"sett": "Y4 R6 (669)34 K40 G4 W6 LV6 W6 G22", "sett": "Y4 R6 (669)34 K40 G4 W6 LV6 W6 G22",
"description": "Wikipedia lists the sett as [Y/6] R4 MB26 K32 G4 W4 Lv4 W4 [G/44]. I'm not familiar with the [Color/Count] notation, the count appears to be doubled, possibly to indicate the total count of that thread in the mirror section.\n\nColorado house joint resolution 97-1016 makes this official but doesnt provide a thread count. It speaks of \"cerulean blue\" which I approximate with the unique (669) color." "description": "Wikipedia lists the sett as [Y/6] R4 MB26 K32 G4 W4 Lv4 W4 [G/44]. I'm not familiar with the [Color/Count] notation, the count appears to be doubled, possibly to indicate the total count of that thread in the mirror section.\n\nColorado house joint resolution 97-1016 makes this official but doesnt provide a thread count. It speaks of \"cerulean blue\" which I approximate with the unique (669) color."

View File

@ -54,6 +54,11 @@ function Loom(ctx, warp, threadwidth) {
ctx.lineWidth = Number(threadwidth || 2); ctx.lineWidth = Number(threadwidth || 2);
// Avoid infinite loop
if (warp.length == 0) {
return;
}
// Draw the weft // Draw the weft
for (var x = 0; x < width; ) { for (var x = 0; x < width; ) {
for (var i in warp) { for (var i in warp) {
@ -238,7 +243,11 @@ function init() {
presetInput.appendChild(opt); presetInput.appendChild(opt);
} }
if (presetName) {
preset(); preset();
} else {
update();
}
} }
window.addEventListener("load", init); window.addEventListener("load", init);