+
+ Discover {count?.toLocaleString()}{' '}
+ collectives {host.root ? 'on' : 'hosted by'}{' '}
+ {host.name.split(' ').map(word => {
+ return (
+
+ {word}
+
+ );
+ })}
+ making an impact{' '}
+ in
+ {tags.map((tag, i, arr) => {
+ return (
+
+ {tag}
+ {arr.length - 1 === i ? ' ' : ', '}
+
+ );
+ })}
+ and more.
+
+
+ ),
+ {
+ width: 1200,
+ height: 600,
+ fonts: [
+ {
+ name: 'Inter',
+ data: fontData,
+ style: 'normal',
+ },
+ ],
+ },
+ );
+}
diff --git a/tsconfig.json b/tsconfig.json
index 79e68c0..cbecb61 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -8,7 +8,7 @@
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
- "module": "commonjs",
+ "module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
diff --git a/utils/categories.ts b/utils/categories.ts
index 84d299a..40e5cc0 100644
--- a/utils/categories.ts
+++ b/utils/categories.ts
@@ -78,6 +78,6 @@ export const createCategories = ({
return categories.map((category, i, arr) => ({
...category,
- color: pickColorForCategory('blue', i, arr.length),
+ color: pickColorForCategory(host.color.closestPaletteColor, i, arr.length),
}));
};
diff --git a/utils/colors.ts b/utils/colors.ts
index 49e20ff..c393376 100644
--- a/utils/colors.ts
+++ b/utils/colors.ts
@@ -20,6 +20,6 @@ const colors = [
export const pickColorForCategory = (startColor: string, i: number, numOfCategories: number) => {
const startColorIndex = colors.findIndex(c => c.name === startColor);
- const step = Math.floor(colors.length / numOfCategories);
- return colors[(startColorIndex + i * step) % colors.length];
+ const step = colors.length / numOfCategories;
+ return colors[(startColorIndex + Math.round(i * step)) % colors.length];
};