GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bertin/src/quickdraw.js at main · riatelab/bertin

Expand file tree

/

quickdraw.js

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
65 lines (56 loc) · 1.29 KB
/

quickdraw.js

Copy path

File metadata and controls

65 lines (56 loc) · 1.29 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { draw } from "./draw.js";
import { figuration } from "./helpers/figuration.js";
export function quickdraw(layers, w = 1000, m = 5) {
let cols = [
"#66c2a5",
"#fc8d62",
"#8da0cb",
"#e78ac3",
"#a6d854",
"#ffd92f",
"#e5c494",
"#b3b3b3",
];
let used = [];
if (Array.isArray(layers)) {
let myarray = [];
layers.forEach((x) => {
let remainingcols = cols.filter((x) => !used.includes(x));
let col;
if (remainingcols.length > 0) {
col = remainingcols[Math.floor(Math.random() * remainingcols.length)];
used.push(col);
} else {
col = "#" + ((Math.random() * 0xffffff) << 0).toString(16);
}
let stroke;
let fill;
// Auto colors
if (figuration(x) == "l") {
stroke = col;
fill = "none";
}
if (figuration(x) == "p" || figuration(x) == "z") {
stroke = "none";
fill = col;
}
myarray.push({
type: "layer",
geojson: x,
fill,
stroke,
});
});
return draw({ params: { margin: m, width: w }, layers: myarray });
} else {
return draw({
params: { margin: m, width: w },
layers: [
{
type: "layer",
geojson: layers,
},
],
});
}
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.