basemapkit
Version:
<p align="center"> <img src="./public/logo.svg" alt="Basemapkit logo" width="400px"></img> </p> <p align="center"> Basemaps for <a href="https://maplibre.org/maplibre-gl-js/docs/">Maplibre GL JS</a> + <a href="https://protomaps.com/">Protomaps</a> </p>
1,702 lines • 86.9 kB
JavaScript
import { language_script_pairs as D, get_country_name as q, get_multiline_name as P } from "@protomaps/basemaps";
const k = {
aliceblue: [240, 248, 255],
antiquewhite: [250, 235, 215],
aqua: [0, 255, 255],
aquamarine: [127, 255, 212],
azure: [240, 255, 255],
beige: [245, 245, 220],
bisque: [255, 228, 196],
black: [0, 0, 0],
blanchedalmond: [255, 235, 205],
blue: [0, 0, 255],
blueviolet: [138, 43, 226],
brown: [165, 42, 42],
burlywood: [222, 184, 135],
cadetblue: [95, 158, 160],
chartreuse: [127, 255, 0],
chocolate: [210, 105, 30],
coral: [255, 127, 80],
cornflowerblue: [100, 149, 237],
cornsilk: [255, 248, 220],
crimson: [220, 20, 60],
cyan: [0, 255, 255],
darkblue: [0, 0, 139],
darkcyan: [0, 139, 139],
darkgoldenrod: [184, 134, 11],
darkgray: [169, 169, 169],
darkgreen: [0, 100, 0],
darkgrey: [169, 169, 169],
darkkhaki: [189, 183, 107],
darkmagenta: [139, 0, 139],
darkolivegreen: [85, 107, 47],
darkorange: [255, 140, 0],
darkorchid: [153, 50, 204],
darkred: [139, 0, 0],
darksalmon: [233, 150, 122],
darkseagreen: [143, 188, 143],
darkslateblue: [72, 61, 139],
darkslategray: [47, 79, 79],
darkslategrey: [47, 79, 79],
darkturquoise: [0, 206, 209],
darkviolet: [148, 0, 211],
deeppink: [255, 20, 147],
deepskyblue: [0, 191, 255],
dimgray: [105, 105, 105],
dimgrey: [105, 105, 105],
dodgerblue: [30, 144, 255],
firebrick: [178, 34, 34],
floralwhite: [255, 250, 240],
forestgreen: [34, 139, 34],
fuchsia: [255, 0, 255],
gainsboro: [220, 220, 220],
ghostwhite: [248, 248, 255],
gold: [255, 215, 0],
goldenrod: [218, 165, 32],
gray: [128, 128, 128],
green: [0, 128, 0],
greenyellow: [173, 255, 47],
grey: [128, 128, 128],
honeydew: [240, 255, 240],
hotpink: [255, 105, 180],
indianred: [205, 92, 92],
indigo: [75, 0, 130],
ivory: [255, 255, 240],
khaki: [240, 230, 140],
lavender: [230, 230, 250],
lavenderblush: [255, 240, 245],
lawngreen: [124, 252, 0],
lemonchiffon: [255, 250, 205],
lightblue: [173, 216, 230],
lightcoral: [240, 128, 128],
lightcyan: [224, 255, 255],
lightgoldenrodyellow: [250, 250, 210],
lightgray: [211, 211, 211],
lightgreen: [144, 238, 144],
lightgrey: [211, 211, 211],
lightpink: [255, 182, 193],
lightsalmon: [255, 160, 122],
lightseagreen: [32, 178, 170],
lightskyblue: [135, 206, 250],
lightslategray: [119, 136, 153],
lightslategrey: [119, 136, 153],
lightsteelblue: [176, 196, 222],
lightyellow: [255, 255, 224],
lime: [0, 255, 0],
limegreen: [50, 205, 50],
linen: [250, 240, 230],
magenta: [255, 0, 255],
maroon: [128, 0, 0],
mediumaquamarine: [102, 205, 170],
mediumblue: [0, 0, 205],
mediumorchid: [186, 85, 211],
mediumpurple: [147, 112, 219],
mediumseagreen: [60, 179, 113],
mediumslateblue: [123, 104, 238],
mediumspringgreen: [0, 250, 154],
mediumturquoise: [72, 209, 204],
mediumvioletred: [199, 21, 133],
midnightblue: [25, 25, 112],
mintcream: [245, 255, 250],
mistyrose: [255, 228, 225],
moccasin: [255, 228, 181],
navajowhite: [255, 222, 173],
navy: [0, 0, 128],
oldlace: [253, 245, 230],
olive: [128, 128, 0],
olivedrab: [107, 142, 35],
orange: [255, 165, 0],
orangered: [255, 69, 0],
orchid: [218, 112, 214],
palegoldenrod: [238, 232, 170],
palegreen: [152, 251, 152],
paleturquoise: [175, 238, 238],
palevioletred: [219, 112, 147],
papayawhip: [255, 239, 213],
peachpuff: [255, 218, 185],
peru: [205, 133, 63],
pink: [255, 192, 203],
plum: [221, 160, 221],
powderblue: [176, 224, 230],
purple: [128, 0, 128],
rebeccapurple: [102, 51, 153],
red: [255, 0, 0],
rosybrown: [188, 143, 143],
royalblue: [65, 105, 225],
saddlebrown: [139, 69, 19],
salmon: [250, 128, 114],
sandybrown: [244, 164, 96],
seagreen: [46, 139, 87],
seashell: [255, 245, 238],
sienna: [160, 82, 45],
silver: [192, 192, 192],
skyblue: [135, 206, 235],
slateblue: [106, 90, 205],
slategray: [112, 128, 144],
slategrey: [112, 128, 144],
snow: [255, 250, 250],
springgreen: [0, 255, 127],
steelblue: [70, 130, 180],
tan: [210, 180, 140],
teal: [0, 128, 128],
thistle: [216, 191, 216],
tomato: [255, 99, 71],
turquoise: [64, 224, 208],
violet: [238, 130, 238],
wheat: [245, 222, 179],
white: [255, 255, 255],
whitesmoke: [245, 245, 245],
yellow: [255, 255, 0],
yellowgreen: [154, 205, 50]
}, B = /* @__PURE__ */ Object.create(null);
for (const n in k)
Object.hasOwn(k, n) && (B[k[n]] = n);
const y = {
to: {},
get: {}
};
y.get = function(n) {
const e = n.slice(0, 3).toLowerCase();
let t, o;
switch (e) {
case "hsl": {
t = y.get.hsl(n), o = "hsl";
break;
}
case "hwb": {
t = y.get.hwb(n), o = "hwb";
break;
}
default: {
t = y.get.rgb(n), o = "rgb";
break;
}
}
return t ? { model: o, value: t } : null;
};
y.get.rgb = function(n) {
if (!n)
return null;
const e = /^#([a-f\d]{3,4})$/i, t = /^#([a-f\d]{6})([a-f\d]{2})?$/i, o = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, i = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, l = /^(\w+)$/;
let r = [0, 0, 0, 1], a, s, u;
if (a = n.match(t)) {
for (u = a[2], a = a[1], s = 0; s < 3; s++) {
const _ = s * 2;
r[s] = Number.parseInt(a.slice(_, _ + 2), 16);
}
u && (r[3] = Number.parseInt(u, 16) / 255);
} else if (a = n.match(e)) {
for (a = a[1], u = a[3], s = 0; s < 3; s++)
r[s] = Number.parseInt(a[s] + a[s], 16);
u && (r[3] = Number.parseInt(u + u, 16) / 255);
} else if (a = n.match(o)) {
for (s = 0; s < 3; s++)
r[s] = Number.parseInt(a[s + 1], 10);
a[4] && (r[3] = a[5] ? Number.parseFloat(a[4]) * 0.01 : Number.parseFloat(a[4]));
} else if (a = n.match(i)) {
for (s = 0; s < 3; s++)
r[s] = Math.round(Number.parseFloat(a[s + 1]) * 2.55);
a[4] && (r[3] = a[5] ? Number.parseFloat(a[4]) * 0.01 : Number.parseFloat(a[4]));
} else return (a = n.match(l)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Object.hasOwn(k, a[1]) ? (r = k[a[1]], r[3] = 1, r) : null : null;
for (s = 0; s < 3; s++)
r[s] = z(r[s], 0, 255);
return r[3] = z(r[3], 0, 1), r;
};
y.get.hsl = function(n) {
if (!n)
return null;
const e = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, t = n.match(e);
if (t) {
const o = Number.parseFloat(t[4]), i = (Number.parseFloat(t[1]) % 360 + 360) % 360, l = z(Number.parseFloat(t[2]), 0, 100), r = z(Number.parseFloat(t[3]), 0, 100), a = z(Number.isNaN(o) ? 1 : o, 0, 1);
return [i, l, r, a];
}
return null;
};
y.get.hwb = function(n) {
if (!n)
return null;
const e = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, t = n.match(e);
if (t) {
const o = Number.parseFloat(t[4]), i = (Number.parseFloat(t[1]) % 360 + 360) % 360, l = z(Number.parseFloat(t[2]), 0, 100), r = z(Number.parseFloat(t[3]), 0, 100), a = z(Number.isNaN(o) ? 1 : o, 0, 1);
return [i, l, r, a];
}
return null;
};
y.to.hex = function(...n) {
return "#" + A(n[0]) + A(n[1]) + A(n[2]) + (n[3] < 1 ? A(Math.round(n[3] * 255)) : "");
};
y.to.rgb = function(...n) {
return n.length < 4 || n[3] === 1 ? "rgb(" + Math.round(n[0]) + ", " + Math.round(n[1]) + ", " + Math.round(n[2]) + ")" : "rgba(" + Math.round(n[0]) + ", " + Math.round(n[1]) + ", " + Math.round(n[2]) + ", " + n[3] + ")";
};
y.to.rgb.percent = function(...n) {
const e = Math.round(n[0] / 255 * 100), t = Math.round(n[1] / 255 * 100), o = Math.round(n[2] / 255 * 100);
return n.length < 4 || n[3] === 1 ? "rgb(" + e + "%, " + t + "%, " + o + "%)" : "rgba(" + e + "%, " + t + "%, " + o + "%, " + n[3] + ")";
};
y.to.hsl = function(...n) {
return n.length < 4 || n[3] === 1 ? "hsl(" + n[0] + ", " + n[1] + "%, " + n[2] + "%)" : "hsla(" + n[0] + ", " + n[1] + "%, " + n[2] + "%, " + n[3] + ")";
};
y.to.hwb = function(...n) {
let e = "";
return n.length >= 4 && n[3] !== 1 && (e = ", " + n[3]), "hwb(" + n[0] + ", " + n[1] + "%, " + n[2] + "%" + e + ")";
};
y.to.keyword = function(...n) {
return B[n.slice(0, 3)];
};
function z(n, e, t) {
return Math.min(Math.max(e, n), t);
}
function A(n) {
const e = Math.round(n).toString(16).toUpperCase();
return e.length < 2 ? "0" + e : e;
}
const J = {};
for (const n of Object.keys(k))
J[k[n]] = n;
const c = {
rgb: { channels: 3, labels: "rgb" },
hsl: { channels: 3, labels: "hsl" },
hsv: { channels: 3, labels: "hsv" },
hwb: { channels: 3, labels: "hwb" },
cmyk: { channels: 4, labels: "cmyk" },
xyz: { channels: 3, labels: "xyz" },
lab: { channels: 3, labels: "lab" },
oklab: { channels: 3, labels: ["okl", "oka", "okb"] },
lch: { channels: 3, labels: "lch" },
oklch: { channels: 3, labels: ["okl", "okc", "okh"] },
hex: { channels: 1, labels: ["hex"] },
keyword: { channels: 1, labels: ["keyword"] },
ansi16: { channels: 1, labels: ["ansi16"] },
ansi256: { channels: 1, labels: ["ansi256"] },
hcg: { channels: 3, labels: ["h", "c", "g"] },
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
gray: { channels: 1, labels: ["gray"] }
}, v = (6 / 29) ** 3;
function N(n) {
const e = n > 31308e-7 ? 1.055 * n ** 0.4166666666666667 - 0.055 : n * 12.92;
return Math.min(Math.max(0, e), 1);
}
function S(n) {
return n > 0.04045 ? ((n + 0.055) / 1.055) ** 2.4 : n / 12.92;
}
for (const n of Object.keys(c)) {
if (!("channels" in c[n]))
throw new Error("missing channels property: " + n);
if (!("labels" in c[n]))
throw new Error("missing channel labels property: " + n);
if (c[n].labels.length !== c[n].channels)
throw new Error("channel and label counts mismatch: " + n);
const { channels: e, labels: t } = c[n];
delete c[n].channels, delete c[n].labels, Object.defineProperty(c[n], "channels", { value: e }), Object.defineProperty(c[n], "labels", { value: t });
}
c.rgb.hsl = function(n) {
const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.min(e, t, o), l = Math.max(e, t, o), r = l - i;
let a, s;
switch (l) {
case i: {
a = 0;
break;
}
case e: {
a = (t - o) / r;
break;
}
case t: {
a = 2 + (o - e) / r;
break;
}
case o: {
a = 4 + (e - t) / r;
break;
}
}
a = Math.min(a * 60, 360), a < 0 && (a += 360);
const u = (i + l) / 2;
return l === i ? s = 0 : u <= 0.5 ? s = r / (l + i) : s = r / (2 - l - i), [a, s * 100, u * 100];
};
c.rgb.hsv = function(n) {
let e, t, o, i, l;
const r = n[0] / 255, a = n[1] / 255, s = n[2] / 255, u = Math.max(r, a, s), _ = u - Math.min(r, a, s), m = function(F) {
return (u - F) / 6 / _ + 1 / 2;
};
if (_ === 0)
i = 0, l = 0;
else {
switch (l = _ / u, e = m(r), t = m(a), o = m(s), u) {
case r: {
i = o - t;
break;
}
case a: {
i = 1 / 3 + e - o;
break;
}
case s: {
i = 2 / 3 + t - e;
break;
}
}
i < 0 ? i += 1 : i > 1 && (i -= 1);
}
return [
i * 360,
l * 100,
u * 100
];
};
c.rgb.hwb = function(n) {
const e = n[0], t = n[1];
let o = n[2];
const i = c.rgb.hsl(n)[0], l = 1 / 255 * Math.min(e, Math.min(t, o));
return o = 1 - 1 / 255 * Math.max(e, Math.max(t, o)), [i, l * 100, o * 100];
};
c.rgb.oklab = function(n) {
const e = S(n[0] / 255), t = S(n[1] / 255), o = S(n[2] / 255), i = Math.cbrt(0.4122214708 * e + 0.5363325363 * t + 0.0514459929 * o), l = Math.cbrt(0.2119034982 * e + 0.6806995451 * t + 0.1073969566 * o), r = Math.cbrt(0.0883024619 * e + 0.2817188376 * t + 0.6299787005 * o), a = 0.2104542553 * i + 0.793617785 * l - 0.0040720468 * r, s = 1.9779984951 * i - 2.428592205 * l + 0.4505937099 * r, u = 0.0259040371 * i + 0.7827717662 * l - 0.808675766 * r;
return [a * 100, s * 100, u * 100];
};
c.rgb.cmyk = function(n) {
const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.min(1 - e, 1 - t, 1 - o), l = (1 - e - i) / (1 - i) || 0, r = (1 - t - i) / (1 - i) || 0, a = (1 - o - i) / (1 - i) || 0;
return [l * 100, r * 100, a * 100, i * 100];
};
function V(n, e) {
return (n[0] - e[0]) ** 2 + (n[1] - e[1]) ** 2 + (n[2] - e[2]) ** 2;
}
c.rgb.keyword = function(n) {
const e = J[n];
if (e)
return e;
let t = Number.POSITIVE_INFINITY, o;
for (const i of Object.keys(k)) {
const l = k[i], r = V(n, l);
r < t && (t = r, o = i);
}
return o;
};
c.keyword.rgb = function(n) {
return k[n];
};
c.rgb.xyz = function(n) {
const e = S(n[0] / 255), t = S(n[1] / 255), o = S(n[2] / 255), i = e * 0.4124564 + t * 0.3575761 + o * 0.1804375, l = e * 0.2126729 + t * 0.7151522 + o * 0.072175, r = e * 0.0193339 + t * 0.119192 + o * 0.9503041;
return [i * 100, l * 100, r * 100];
};
c.rgb.lab = function(n) {
const e = c.rgb.xyz(n);
let t = e[0], o = e[1], i = e[2];
t /= 95.047, o /= 100, i /= 108.883, t = t > v ? t ** (1 / 3) : 7.787 * t + 16 / 116, o = o > v ? o ** (1 / 3) : 7.787 * o + 16 / 116, i = i > v ? i ** (1 / 3) : 7.787 * i + 16 / 116;
const l = 116 * o - 16, r = 500 * (t - o), a = 200 * (o - i);
return [l, r, a];
};
c.hsl.rgb = function(n) {
const e = n[0] / 360, t = n[1] / 100, o = n[2] / 100;
let i, l;
if (t === 0)
return l = o * 255, [l, l, l];
const r = o < 0.5 ? o * (1 + t) : o + t - o * t, a = 2 * o - r, s = [0, 0, 0];
for (let u = 0; u < 3; u++)
i = e + 1 / 3 * -(u - 1), i < 0 && i++, i > 1 && i--, 6 * i < 1 ? l = a + (r - a) * 6 * i : 2 * i < 1 ? l = r : 3 * i < 2 ? l = a + (r - a) * (2 / 3 - i) * 6 : l = a, s[u] = l * 255;
return s;
};
c.hsl.hsv = function(n) {
const e = n[0];
let t = n[1] / 100, o = n[2] / 100, i = t;
const l = Math.max(o, 0.01);
o *= 2, t *= o <= 1 ? o : 2 - o, i *= l <= 1 ? l : 2 - l;
const r = (o + t) / 2, a = o === 0 ? 2 * i / (l + i) : 2 * t / (o + t);
return [e, a * 100, r * 100];
};
c.hsv.rgb = function(n) {
const e = n[0] / 60, t = n[1] / 100;
let o = n[2] / 100;
const i = Math.floor(e) % 6, l = e - Math.floor(e), r = 255 * o * (1 - t), a = 255 * o * (1 - t * l), s = 255 * o * (1 - t * (1 - l));
switch (o *= 255, i) {
case 0:
return [o, s, r];
case 1:
return [a, o, r];
case 2:
return [r, o, s];
case 3:
return [r, a, o];
case 4:
return [s, r, o];
case 5:
return [o, r, a];
}
};
c.hsv.hsl = function(n) {
const e = n[0], t = n[1] / 100, o = n[2] / 100, i = Math.max(o, 0.01);
let l, r;
r = (2 - t) * o;
const a = (2 - t) * i;
return l = t * i, l /= a <= 1 ? a : 2 - a, l = l || 0, r /= 2, [e, l * 100, r * 100];
};
c.hwb.rgb = function(n) {
const e = n[0] / 360;
let t = n[1] / 100, o = n[2] / 100;
const i = t + o;
let l;
i > 1 && (t /= i, o /= i);
const r = Math.floor(6 * e), a = 1 - o;
l = 6 * e - r, (r & 1) !== 0 && (l = 1 - l);
const s = t + l * (a - t);
let u, _, m;
switch (r) {
default:
case 6:
case 0: {
u = a, _ = s, m = t;
break;
}
case 1: {
u = s, _ = a, m = t;
break;
}
case 2: {
u = t, _ = a, m = s;
break;
}
case 3: {
u = t, _ = s, m = a;
break;
}
case 4: {
u = s, _ = t, m = a;
break;
}
case 5: {
u = a, _ = t, m = s;
break;
}
}
return [u * 255, _ * 255, m * 255];
};
c.cmyk.rgb = function(n) {
const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = n[3] / 100, l = 1 - Math.min(1, e * (1 - i) + i), r = 1 - Math.min(1, t * (1 - i) + i), a = 1 - Math.min(1, o * (1 - i) + i);
return [l * 255, r * 255, a * 255];
};
c.xyz.rgb = function(n) {
const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100;
let i, l, r;
return i = e * 3.2404542 + t * -1.5371385 + o * -0.4985314, l = e * -0.969266 + t * 1.8760108 + o * 0.041556, r = e * 0.0556434 + t * -0.2040259 + o * 1.0572252, i = N(i), l = N(l), r = N(r), [i * 255, l * 255, r * 255];
};
c.xyz.lab = function(n) {
let e = n[0], t = n[1], o = n[2];
e /= 95.047, t /= 100, o /= 108.883, e = e > v ? e ** (1 / 3) : 7.787 * e + 16 / 116, t = t > v ? t ** (1 / 3) : 7.787 * t + 16 / 116, o = o > v ? o ** (1 / 3) : 7.787 * o + 16 / 116;
const i = 116 * t - 16, l = 500 * (e - t), r = 200 * (t - o);
return [i, l, r];
};
c.xyz.oklab = function(n) {
const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = Math.cbrt(0.8189330101 * e + 0.3618667424 * t - 0.1288597137 * o), l = Math.cbrt(0.0329845436 * e + 0.9293118715 * t + 0.0361456387 * o), r = Math.cbrt(0.0482003018 * e + 0.2643662691 * t + 0.633851707 * o), a = 0.2104542553 * i + 0.793617785 * l - 0.0040720468 * r, s = 1.9779984951 * i - 2.428592205 * l + 0.4505937099 * r, u = 0.0259040371 * i + 0.7827717662 * l - 0.808675766 * r;
return [a * 100, s * 100, u * 100];
};
c.oklab.oklch = function(n) {
return c.lab.lch(n);
};
c.oklab.xyz = function(n) {
const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = (0.999999998 * e + 0.396337792 * t + 0.215803758 * o) ** 3, l = (1.000000008 * e - 0.105561342 * t - 0.063854175 * o) ** 3, r = (1.000000055 * e - 0.089484182 * t - 1.291485538 * o) ** 3, a = 1.227013851 * i - 0.55779998 * l + 0.281256149 * r, s = -0.040580178 * i + 1.11225687 * l - 0.071676679 * r, u = -0.076381285 * i - 0.421481978 * l + 1.58616322 * r;
return [a * 100, s * 100, u * 100];
};
c.oklab.rgb = function(n) {
const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = (e + 0.3963377774 * t + 0.2158037573 * o) ** 3, l = (e - 0.1055613458 * t - 0.0638541728 * o) ** 3, r = (e - 0.0894841775 * t - 1.291485548 * o) ** 3, a = N(4.0767416621 * i - 3.3077115913 * l + 0.2309699292 * r), s = N(-1.2684380046 * i + 2.6097574011 * l - 0.3413193965 * r), u = N(-0.0041960863 * i - 0.7034186147 * l + 1.707614701 * r);
return [a * 255, s * 255, u * 255];
};
c.oklch.oklab = function(n) {
return c.lch.lab(n);
};
c.lab.xyz = function(n) {
const e = n[0], t = n[1], o = n[2];
let i, l, r;
l = (e + 16) / 116, i = t / 500 + l, r = l - o / 200;
const a = l ** 3, s = i ** 3, u = r ** 3;
return l = a > v ? a : (l - 16 / 116) / 7.787, i = s > v ? s : (i - 16 / 116) / 7.787, r = u > v ? u : (r - 16 / 116) / 7.787, i *= 95.047, l *= 100, r *= 108.883, [i, l, r];
};
c.lab.lch = function(n) {
const e = n[0], t = n[1], o = n[2];
let i;
i = Math.atan2(o, t) * 360 / 2 / Math.PI, i < 0 && (i += 360);
const r = Math.sqrt(t * t + o * o);
return [e, r, i];
};
c.lch.lab = function(n) {
const e = n[0], t = n[1], i = n[2] / 360 * 2 * Math.PI, l = t * Math.cos(i), r = t * Math.sin(i);
return [e, l, r];
};
c.rgb.ansi16 = function(n, e = null) {
const [t, o, i] = n;
let l = e === null ? c.rgb.hsv(n)[2] : e;
if (l = Math.round(l / 50), l === 0)
return 30;
let r = 30 + (Math.round(i / 255) << 2 | Math.round(o / 255) << 1 | Math.round(t / 255));
return l === 2 && (r += 60), r;
};
c.hsv.ansi16 = function(n) {
return c.rgb.ansi16(c.hsv.rgb(n), n[2]);
};
c.rgb.ansi256 = function(n) {
const e = n[0], t = n[1], o = n[2];
return e >> 4 === t >> 4 && t >> 4 === o >> 4 ? e < 8 ? 16 : e > 248 ? 231 : Math.round((e - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(e / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(o / 255 * 5);
};
c.ansi16.rgb = function(n) {
n = n[0];
let e = n % 10;
if (e === 0 || e === 7)
return n > 50 && (e += 3.5), e = e / 10.5 * 255, [e, e, e];
const t = (Math.trunc(n > 50) + 1) * 0.5, o = (e & 1) * t * 255, i = (e >> 1 & 1) * t * 255, l = (e >> 2 & 1) * t * 255;
return [o, i, l];
};
c.ansi256.rgb = function(n) {
if (n = n[0], n >= 232) {
const l = (n - 232) * 10 + 8;
return [l, l, l];
}
n -= 16;
let e;
const t = Math.floor(n / 36) / 5 * 255, o = Math.floor((e = n % 36) / 6) / 5 * 255, i = e % 6 / 5 * 255;
return [t, o, i];
};
c.rgb.hex = function(n) {
const t = (((Math.round(n[0]) & 255) << 16) + ((Math.round(n[1]) & 255) << 8) + (Math.round(n[2]) & 255)).toString(16).toUpperCase();
return "000000".slice(t.length) + t;
};
c.hex.rgb = function(n) {
const e = n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
if (!e)
return [0, 0, 0];
let t = e[0];
e[0].length === 3 && (t = [...t].map((a) => a + a).join(""));
const o = Number.parseInt(t, 16), i = o >> 16 & 255, l = o >> 8 & 255, r = o & 255;
return [i, l, r];
};
c.rgb.hcg = function(n) {
const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.max(Math.max(e, t), o), l = Math.min(Math.min(e, t), o), r = i - l;
let a;
const s = r < 1 ? l / (1 - r) : 0;
return r <= 0 ? a = 0 : i === e ? a = (t - o) / r % 6 : i === t ? a = 2 + (o - e) / r : a = 4 + (e - t) / r, a /= 6, a %= 1, [a * 360, r * 100, s * 100];
};
c.hsl.hcg = function(n) {
const e = n[1] / 100, t = n[2] / 100, o = t < 0.5 ? 2 * e * t : 2 * e * (1 - t);
let i = 0;
return o < 1 && (i = (t - 0.5 * o) / (1 - o)), [n[0], o * 100, i * 100];
};
c.hsv.hcg = function(n) {
const e = n[1] / 100, t = n[2] / 100, o = e * t;
let i = 0;
return o < 1 && (i = (t - o) / (1 - o)), [n[0], o * 100, i * 100];
};
c.hcg.rgb = function(n) {
const e = n[0] / 360, t = n[1] / 100, o = n[2] / 100;
if (t === 0)
return [o * 255, o * 255, o * 255];
const i = [0, 0, 0], l = e % 1 * 6, r = l % 1, a = 1 - r;
let s = 0;
switch (Math.floor(l)) {
case 0: {
i[0] = 1, i[1] = r, i[2] = 0;
break;
}
case 1: {
i[0] = a, i[1] = 1, i[2] = 0;
break;
}
case 2: {
i[0] = 0, i[1] = 1, i[2] = r;
break;
}
case 3: {
i[0] = 0, i[1] = a, i[2] = 1;
break;
}
case 4: {
i[0] = r, i[1] = 0, i[2] = 1;
break;
}
default:
i[0] = 1, i[1] = 0, i[2] = a;
}
return s = (1 - t) * o, [
(t * i[0] + s) * 255,
(t * i[1] + s) * 255,
(t * i[2] + s) * 255
];
};
c.hcg.hsv = function(n) {
const e = n[1] / 100, t = n[2] / 100, o = e + t * (1 - e);
let i = 0;
return o > 0 && (i = e / o), [n[0], i * 100, o * 100];
};
c.hcg.hsl = function(n) {
const e = n[1] / 100, o = n[2] / 100 * (1 - e) + 0.5 * e;
let i = 0;
return o > 0 && o < 0.5 ? i = e / (2 * o) : o >= 0.5 && o < 1 && (i = e / (2 * (1 - o))), [n[0], i * 100, o * 100];
};
c.hcg.hwb = function(n) {
const e = n[1] / 100, t = n[2] / 100, o = e + t * (1 - e);
return [n[0], (o - e) * 100, (1 - o) * 100];
};
c.hwb.hcg = function(n) {
const e = n[1] / 100, o = 1 - n[2] / 100, i = o - e;
let l = 0;
return i < 1 && (l = (o - i) / (1 - i)), [n[0], i * 100, l * 100];
};
c.apple.rgb = function(n) {
return [n[0] / 65535 * 255, n[1] / 65535 * 255, n[2] / 65535 * 255];
};
c.rgb.apple = function(n) {
return [n[0] / 255 * 65535, n[1] / 255 * 65535, n[2] / 255 * 65535];
};
c.gray.rgb = function(n) {
return [n[0] / 100 * 255, n[0] / 100 * 255, n[0] / 100 * 255];
};
c.gray.hsl = function(n) {
return [0, 0, n[0]];
};
c.gray.hsv = c.gray.hsl;
c.gray.hwb = function(n) {
return [0, 100, n[0]];
};
c.gray.cmyk = function(n) {
return [0, 0, 0, n[0]];
};
c.gray.lab = function(n) {
return [n[0], 0, 0];
};
c.gray.hex = function(n) {
const e = Math.round(n[0] / 100 * 255) & 255, o = ((e << 16) + (e << 8) + e).toString(16).toUpperCase();
return "000000".slice(o.length) + o;
};
c.rgb.gray = function(n) {
return [(n[0] + n[1] + n[2]) / 3 / 255 * 100];
};
function Q() {
const n = {}, e = Object.keys(c);
for (let { length: t } = e, o = 0; o < t; o++)
n[e[o]] = {
// http://jsperf.com/1-vs-infinity
// micro-opt, but this is simple.
distance: -1,
parent: null
};
return n;
}
function X(n) {
const e = Q(), t = [n];
for (e[n].distance = 0; t.length > 0; ) {
const o = t.pop(), i = Object.keys(c[o]);
for (let { length: l } = i, r = 0; r < l; r++) {
const a = i[r], s = e[a];
s.distance === -1 && (s.distance = e[o].distance + 1, s.parent = o, t.unshift(a));
}
}
return e;
}
function Z(n, e) {
return function(t) {
return e(n(t));
};
}
function nn(n, e) {
const t = [e[n].parent, n];
let o = c[e[n].parent][n], i = e[n].parent;
for (; e[i].parent; )
t.unshift(e[i].parent), o = Z(c[e[i].parent][i], o), i = e[i].parent;
return o.conversion = t, o;
}
function en(n) {
const e = X(n), t = {}, o = Object.keys(e);
for (let { length: i } = o, l = 0; l < i; l++) {
const r = o[l];
e[r].parent !== null && (t[r] = nn(r, e));
}
return t;
}
const b = {}, tn = Object.keys(c);
function on(n) {
const e = function(...t) {
const o = t[0];
return o == null ? o : (o.length > 1 && (t = o), n(t));
};
return "conversion" in n && (e.conversion = n.conversion), e;
}
function rn(n) {
const e = function(...t) {
const o = t[0];
if (o == null)
return o;
o.length > 1 && (t = o);
const i = n(t);
if (typeof i == "object")
for (let { length: l } = i, r = 0; r < l; r++)
i[r] = Math.round(i[r]);
return i;
};
return "conversion" in n && (e.conversion = n.conversion), e;
}
for (const n of tn) {
b[n] = {}, Object.defineProperty(b[n], "channels", { value: c[n].channels }), Object.defineProperty(b[n], "labels", { value: c[n].labels });
const e = en(n), t = Object.keys(e);
for (const o of t) {
const i = e[o];
b[n][o] = rn(i), b[n][o].raw = on(i);
}
}
const K = [
// To be honest, I don't really feel like keyword belongs in color convert, but eh.
"keyword",
// Gray conflicts with some method names, and has its own method defined.
"gray",
// Shouldn't really be in color-convert either...
"hex"
], I = {};
for (const n of Object.keys(b))
I[[...b[n].labels].sort().join("")] = n;
const C = {};
function h(n, e) {
if (!(this instanceof h))
return new h(n, e);
if (e && e in K && (e = null), e && !(e in b))
throw new Error("Unknown model: " + e);
let t, o;
if (n == null)
this.model = "rgb", this.color = [0, 0, 0], this.valpha = 1;
else if (n instanceof h)
this.model = n.model, this.color = [...n.color], this.valpha = n.valpha;
else if (typeof n == "string") {
const i = y.get(n);
if (i === null)
throw new Error("Unable to parse color from string: " + n);
this.model = i.model, o = b[this.model].channels, this.color = i.value.slice(0, o), this.valpha = typeof i.value[o] == "number" ? i.value[o] : 1;
} else if (n.length > 0) {
this.model = e || "rgb", o = b[this.model].channels;
const i = Array.prototype.slice.call(n, 0, o);
this.color = R(i, o), this.valpha = typeof n[o] == "number" ? n[o] : 1;
} else if (typeof n == "number")
this.model = "rgb", this.color = [
n >> 16 & 255,
n >> 8 & 255,
n & 255
], this.valpha = 1;
else {
this.valpha = 1;
const i = Object.keys(n);
"alpha" in n && (i.splice(i.indexOf("alpha"), 1), this.valpha = typeof n.alpha == "number" ? n.alpha : 0);
const l = i.sort().join("");
if (!(l in I))
throw new Error("Unable to parse color from object: " + JSON.stringify(n));
this.model = I[l];
const { labels: r } = b[this.model], a = [];
for (t = 0; t < r.length; t++)
a.push(n[r[t]]);
this.color = R(a);
}
if (C[this.model])
for (o = b[this.model].channels, t = 0; t < o; t++) {
const i = C[this.model][t];
i && (this.color[t] = i(this.color[t]));
}
this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);
}
h.prototype = {
toString() {
return this.string();
},
toJSON() {
return this[this.model]();
},
string(n) {
let e = this.model in y.to ? this : this.rgb();
e = e.round(typeof n == "number" ? n : 1);
const t = e.valpha === 1 ? e.color : [...e.color, this.valpha];
return y.to[e.model](...t);
},
percentString(n) {
const e = this.rgb().round(typeof n == "number" ? n : 1), t = e.valpha === 1 ? e.color : [...e.color, this.valpha];
return y.to.rgb.percent(...t);
},
array() {
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
},
object() {
const n = {}, { channels: e } = b[this.model], { labels: t } = b[this.model];
for (let o = 0; o < e; o++)
n[t[o]] = this.color[o];
return this.valpha !== 1 && (n.alpha = this.valpha), n;
},
unitArray() {
const n = this.rgb().color;
return n[0] /= 255, n[1] /= 255, n[2] /= 255, this.valpha !== 1 && n.push(this.valpha), n;
},
unitObject() {
const n = this.rgb().object();
return n.r /= 255, n.g /= 255, n.b /= 255, this.valpha !== 1 && (n.alpha = this.valpha), n;
},
round(n) {
return n = Math.max(n || 0, 0), new h([...this.color.map(an(n)), this.valpha], this.model);
},
alpha(n) {
return n !== void 0 ? new h([...this.color, Math.max(0, Math.min(1, n))], this.model) : this.valpha;
},
// Rgb
red: d("rgb", 0, f(255)),
green: d("rgb", 1, f(255)),
blue: d("rgb", 2, f(255)),
hue: d(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (n) => (n % 360 + 360) % 360),
saturationl: d("hsl", 1, f(100)),
lightness: d("hsl", 2, f(100)),
saturationv: d("hsv", 1, f(100)),
value: d("hsv", 2, f(100)),
chroma: d("hcg", 1, f(100)),
gray: d("hcg", 2, f(100)),
white: d("hwb", 1, f(100)),
wblack: d("hwb", 2, f(100)),
cyan: d("cmyk", 0, f(100)),
magenta: d("cmyk", 1, f(100)),
yellow: d("cmyk", 2, f(100)),
black: d("cmyk", 3, f(100)),
x: d("xyz", 0, f(95.047)),
y: d("xyz", 1, f(100)),
z: d("xyz", 2, f(108.833)),
l: d("lab", 0, f(100)),
a: d("lab", 1),
b: d("lab", 2),
keyword(n) {
return n !== void 0 ? new h(n) : b[this.model].keyword(this.color);
},
hex(n) {
return n !== void 0 ? new h(n) : y.to.hex(...this.rgb().round().color);
},
hexa(n) {
if (n !== void 0)
return new h(n);
const e = this.rgb().round().color;
let t = Math.round(this.valpha * 255).toString(16).toUpperCase();
return t.length === 1 && (t = "0" + t), y.to.hex(...e) + t;
},
rgbNumber() {
const n = this.rgb().color;
return (n[0] & 255) << 16 | (n[1] & 255) << 8 | n[2] & 255;
},
luminosity() {
const n = this.rgb().color, e = [];
for (const [t, o] of n.entries()) {
const i = o / 255;
e[t] = i <= 0.04045 ? i / 12.92 : ((i + 0.055) / 1.055) ** 2.4;
}
return 0.2126 * e[0] + 0.7152 * e[1] + 0.0722 * e[2];
},
contrast(n) {
const e = this.luminosity(), t = n.luminosity();
return e > t ? (e + 0.05) / (t + 0.05) : (t + 0.05) / (e + 0.05);
},
level(n) {
const e = this.contrast(n);
return e >= 7 ? "AAA" : e >= 4.5 ? "AA" : "";
},
isDark() {
const n = this.rgb().color;
return (n[0] * 2126 + n[1] * 7152 + n[2] * 722) / 1e4 < 128;
},
isLight() {
return !this.isDark();
},
negate() {
const n = this.rgb();
for (let e = 0; e < 3; e++)
n.color[e] = 255 - n.color[e];
return n;
},
lighten(n) {
const e = this.hsl();
return e.color[2] += e.color[2] * n, e;
},
darken(n) {
const e = this.hsl();
return e.color[2] -= e.color[2] * n, e;
},
saturate(n) {
const e = this.hsl();
return e.color[1] += e.color[1] * n, e;
},
desaturate(n) {
const e = this.hsl();
return e.color[1] -= e.color[1] * n, e;
},
whiten(n) {
const e = this.hwb();
return e.color[1] += e.color[1] * n, e;
},
blacken(n) {
const e = this.hwb();
return e.color[2] += e.color[2] * n, e;
},
grayscale() {
const n = this.rgb().color, e = n[0] * 0.3 + n[1] * 0.59 + n[2] * 0.11;
return h.rgb(e, e, e);
},
fade(n) {
return this.alpha(this.valpha - this.valpha * n);
},
opaquer(n) {
return this.alpha(this.valpha + this.valpha * n);
},
rotate(n) {
const e = this.hsl();
let t = e.color[0];
return t = (t + n) % 360, t = t < 0 ? 360 + t : t, e.color[0] = t, e;
},
mix(n, e) {
if (!n || !n.rgb)
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof n);
const t = n.rgb(), o = this.rgb(), i = e === void 0 ? 0.5 : e, l = 2 * i - 1, r = t.alpha() - o.alpha(), a = ((l * r === -1 ? l : (l + r) / (1 + l * r)) + 1) / 2, s = 1 - a;
return h.rgb(
a * t.red() + s * o.red(),
a * t.green() + s * o.green(),
a * t.blue() + s * o.blue(),
t.alpha() * i + o.alpha() * (1 - i)
);
}
};
for (const n of Object.keys(b)) {
if (K.includes(n))
continue;
const { channels: e } = b[n];
h.prototype[n] = function(...t) {
return this.model === n ? new h(this) : t.length > 0 ? new h(t, n) : new h([...sn(b[this.model][n].raw(this.color)), this.valpha], n);
}, h[n] = function(...t) {
let o = t[0];
return typeof o == "number" && (o = R(t, e)), new h(o, n);
};
}
function ln(n, e) {
return Number(n.toFixed(e));
}
function an(n) {
return function(e) {
return ln(e, n);
};
}
function d(n, e, t) {
n = Array.isArray(n) ? n : [n];
for (const o of n)
(C[o] || (C[o] = []))[e] = t;
return n = n[0], function(o) {
let i;
return o !== void 0 ? (t && (o = t(o)), i = this[n](), i.color[e] = o, i) : (i = this[n]().color[e], t && (i = t(i)), i);
};
}
function f(n) {
return function(e) {
return Math.max(0, Math.min(n, e));
};
}
function sn(n) {
return Array.isArray(n) ? n : [n];
}
function R(n, e) {
for (let t = 0; t < e; t++)
typeof n[t] != "number" && (n[t] = 0);
return n;
}
function W(n) {
return !!(typeof n == "string" && (n.startsWith("#") || n.startsWith("rgb(") || n.startsWith("rgba(") || n.startsWith("hsl(") || n.startsWith("hwb(")));
}
function T(n, e) {
if (!(typeof n == "string" || typeof n == "number" || typeof n == "boolean" || n === null || n === void 0)) {
if (Array.isArray(n))
for (let t = 0; t < n.length; t += 1) {
const o = n[t];
if (W(o)) {
n[t] = e(o);
continue;
}
T(o, e);
}
else if (typeof n == "object") {
const t = n, o = Object.keys(n);
for (const i of o) {
const l = t[i];
if (W(l)) {
t[i] = e(l);
continue;
}
T(l, e);
}
}
}
}
function cn(n, e) {
const t = n / 255, o = t + (1 - t) * t * e;
return Math.max(0, Math.min(255, o * 255));
}
function un(n, e) {
return n.map((t) => cn(t, e));
}
function pn(n, e, t = 127) {
const o = Math.max(-0.99, Math.min(0.99, e)), i = o < 0 ? o + 1 : 1 / (1 - o), l = t + i * (n - t);
return Math.round(Math.max(0, Math.min(255, l)));
}
function dn(n, e, t = 127) {
return n.map((o) => pn(o, e, t));
}
function hn(n, e, t = 1) {
return 255 * (n / 255) * (e / 255) * t + n / 255 * (1 - t) * 255;
}
function _n(n, e, t = 1) {
return n.map((o, i) => hn(n[i], e[i], t));
}
const fn = `[
{
"id": "background",
"type": "background",
"layout": {"visibility": "visible"},
"paint": {"background-color": "#cccccc"}
},
{
"id": "earth",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "earth",
"filter": ["==", "$type", "Polygon"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#fcf5e3"}
},
{
"id": "landcover",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landcover",
"filter": [
"all",
[
"in",
"kind",
"grassland",
"barren",
"urban_area",
"farmland",
"glacier",
"scrub"
]
],
"layout": {"visibility": "visible"},
"paint": {
"fill-color": [
"match",
["get", "kind"],
"grassland",
"#cee6b5",
"barren",
"#fff0d4",
"urban_area",
"rgba(230, 230, 230, 1)",
"farmland",
"rgba(192, 222, 160, 0.3)",
"glacier",
"#e6ffff",
"scrub",
"#cee6b5",
"#ff0000"
],
"fill-opacity": [
"interpolate",
["linear"],
["zoom"],
0,
1,
7,
0.8,
8,
0
]
}
},
{
"id": "landuse_residential",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["all", ["==", "kind", "residential"]],
"layout": {"visibility": "visible"},
"paint": {
"fill-opacity": ["interpolate", ["linear"], ["zoom"], 8, 0, 12, 1],
"fill-color": "#f7f3e9"
}
},
{
"id": "landuse_urban_green",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["in", "kind", "allotments", "village_green", "playground"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#9cd3b4", "fill-opacity": 0.7}
},
{
"id": "landuse-sand",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["all", ["==", "kind", "sand"]],
"layout": {"visibility": "visible"},
"paint": {
"fill-opacity": ["interpolate", ["linear"], ["zoom"], 0, 1, 20, 0],
"fill-color": "rgba(240, 226, 199, 1)"
}
},
{
"id": "landuse_bare_rock",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["all", ["in", "kind", "bare_rock"]],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "rgb(221, 226, 226)"}
},
{
"id": "landuse_park",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": [
"all",
[
"in",
"kind",
"meadow",
"park",
"glacier",
"cemetery",
"golf_course",
"scrub",
"grassland",
"grass",
"naval_base",
"airfield"
]
],
"layout": {"visibility": "visible"},
"paint": {
"fill-opacity": 1,
"fill-color": [
"case",
["in", ["get", "kind"], ["literal", ["grass"]]],
"#a5e87d",
["in", ["get", "kind"], ["literal", ["park", "golf_course"]]],
"#b6e996",
["in", ["get", "kind"], ["literal", ["park", "meadow"]]],
"#a6e085",
["in", ["get", "kind"], ["literal", ["scrub", "grassland"]]],
"#cee6b5",
["in", ["get", "kind"], ["literal", ["glacier"]]],
"#e6ffff",
["in", ["get", "kind"], ["literal", ["cemetery"]]],
"#ccdbc5",
["in", ["get", "kind"], ["literal", ["sand"]]],
"#fff3d5",
[
"in",
["get", "kind"],
["literal", ["military", "naval_base", "airfield"]]
],
"#d1dede",
"#e2dfda"
]
}
},
{
"id": "landuse_farmland",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["all", ["==", "kind", "farmland"]],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "rgba(185, 255, 152, 1)", "fill-opacity": 0.2}
},
{
"id": "landuse_pitch",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["all", ["==", "kind", "pitch"]],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "rgba(81, 201, 70, 1)", "fill-opacity": 0.2}
},
{
"id": "landuse_military",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["all", ["==", "kind", "military"]],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "rgba(145, 145, 145, 1)", "fill-opacity": 0.2}
},
{
"id": "landuse_wood-forest",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["all", ["in", "kind", "forest", "wood"]],
"layout": {"visibility": "visible"},
"paint": {
"fill-opacity": ["interpolate", ["linear"], ["zoom"], 0, 1, 7, 1],
"fill-color": "rgb(184, 224, 173)"
}
},
{
"id": "landuse_hospital",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["==", "kind", "hospital"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#e4dad9"}
},
{
"id": "landuse_industrial",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["==", "kind", "industrial"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#d1dde1"}
},
{
"id": "landuse_school",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["in", "kind", "school", "university", "college"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#e4ded7"}
},
{
"id": "landuse_zoo",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["in", "kind", "zoo"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#c6dcdc"}
},
{
"id": "landuse_aerodrome",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["in", "kind", "aerodrome"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#dadbdf"}
},
{
"id": "roads_runway",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": ["==", "kind_detail", "runway"],
"layout": {"visibility": "visible"},
"paint": {
"line-color": "#e9e9ed",
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
10,
0,
12,
4,
18,
30
]
}
},
{
"id": "roads_taxiway",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"minzoom": 13,
"filter": ["==", "kind_detail", "taxiway"],
"layout": {"visibility": "visible"},
"paint": {
"line-color": "#e9e9ed",
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
15,
6
]
}
},
{
"id": "landuse_runway",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["any", ["in", "kind", "runway", "taxiway"]],
"paint": {"fill-color": "#e9e9ed"}
},
{
"id": "water",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "water",
"filter": ["==", "$type", "Polygon"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "rgb(135, 199, 236)"}
},
{
"id": "water_stream",
"type": "line",
"source": "__protomaps_source",
"source-layer": "water",
"minzoom": 14,
"filter": ["in", "kind", "stream"],
"layout": {"visibility": "visible"},
"paint": {"line-width": 0.5, "line-color": "rgba(18, 157, 222, 1)"}
},
{
"id": "landuse_beach",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["in", "kind", "beach"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#fff0d4"}
},
{
"id": "water_river",
"type": "line",
"source": "__protomaps_source",
"source-layer": "water",
"minzoom": 9,
"filter": ["in", "kind", "river"],
"layout": {"visibility": "visible"},
"paint": {
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
9,
0,
9.5,
1,
18,
12
],
"line-color": "#C4EAFF"
}
},
{
"id": "landuse_wetland",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["all", ["==", "kind", "wetland"]],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "rgba(43, 63, 131, 0.07)"}
},
{
"id": "landuse_nature_reserve_bg",
"type": "line",
"source": "__protomaps_source",
"source-layer": "landuse",
"minzoom": 8,
"filter": ["all", ["==", "kind", "nature_reserve"]],
"layout": {"visibility": "visible"},
"paint": {
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
8,
5,
15,
20,
18,
30
],
"line-color": "rgba(5, 109, 0, 0.19)",
"line-opacity": {"stops": [[8, 0], [9, 0.4]]}
}
},
{
"id": "landuse_nature_reserve",
"type": "line",
"source": "__protomaps_source",
"source-layer": "landuse",
"minzoom": 8,
"filter": ["all", ["==", "kind", "nature_reserve"]],
"layout": {"visibility": "visible"},
"paint": {
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
8,
1,
15,
3,
18,
5
],
"line-color": "rgba(5, 109, 0, 0.19)",
"line-opacity": {"stops": [[8, 0], [9, 1]]}
}
},
{
"id": "ferry",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": ["all", ["==", "kind", "ferry"]],
"layout": {"visibility": "visible"},
"paint": {
"line-dasharray": [1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3],
"line-opacity": 0.5,
"line-color": "rgba(76, 154, 205, 1)",
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
6,
1,
18,
3
]
}
},
{
"id": "landuse_pedestrian",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["in", "kind", "pedestrian", "dam"],
"layout": {"visibility": "visible"},
"paint": {"fill-color": "#e3e0d4"}
},
{
"id": "landuse_pier",
"type": "fill",
"source": "__protomaps_source",
"source-layer": "landuse",
"filter": ["==", "kind", "pier"],
"paint": {"fill-color": "#e0e0e0"}
},
{
"id": "roads_tunnels_other_casing",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": ["all", ["has", "is_tunnel"], ["in", "kind", "other", "path"]],
"paint": {
"line-color": "#e0e0e0",
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
14,
0,
20,
7
]
}
},
{
"id": "roads_tunnels_minor_casing",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": ["all", ["has", "is_tunnel"], ["==", "kind", "minor_road"]],
"paint": {
"line-color": "#e0e0e0",
"line-dasharray": [3, 2],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
0,
12.5,
0.5,
15,
2,
18,
11
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
12,
0,
12.5,
1
]
}
},
{
"id": "roads_tunnels_link_casing",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": ["all", ["has", "is_tunnel"], ["has", "is_link"]],
"paint": {
"line-color": "#e0e0e0",
"line-dasharray": [3, 2],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
13,
0,
13.5,
1,
18,
11
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
12,
0,
12.5,
1
]
}
},
{
"id": "roads_tunnels_major_casing",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": [
"all",
["!has", "is_tunnel"],
["!has", "is_bridge"],
["==", "kind", "major_road"]
],
"layout": {"visibility": "visible"},
"paint": {
"line-color": "#e0e0e0",
"line-dasharray": [3, 2],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
0.5,
18,
13
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
9,
0,
9.5,
1
]
}
},
{
"id": "roads_tunnels_highway_casing",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": [
"all",
["!has", "is_tunnel"],
["!has", "is_bridge"],
["==", "kind", "highway"],
["!has", "is_link"]
],
"paint": {
"line-color": "#e0e0e0",
"line-dasharray": [6, 0.5],
"line-gap-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
3,
0,
3.5,
0.5,
18,
15
],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
7,
0,
7.5,
1,
20,
15
]
}
},
{
"id": "roads_tunnels_other",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": ["all", ["has", "is_tunnel"], ["in", "kind", "other", "path"]],
"paint": {
"line-color": "#d5d5d5",
"line-dasharray": [4.5, 0.5],
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
14,
0,
20,
7
]
}
},
{
"id": "roads_tunnels_minor",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": ["all", ["has", "is_tunnel"], ["==", "kind", "minor_road"]],
"paint": {
"line-color": "#d5d5d5",
"line-width": [
"interpolate",
["exponential", 1.6],
["zoom"],
11,
0,
12.5,
0.5,
15,
2,
18,
11
]
}
},
{
"id": "roads_tunnels_link",
"type": "line",
"source": "__protomaps_source",
"source-layer": "roads",
"filter": ["all", ["has", "is_tunnel"], ["has", "is_link"]],
"paint": {
"line-color": "#d5d5d5",
"line-width": [
"interpolate",
["expone