Skip to content

Commit f5eb12d

Browse files
committed
feat(color): update colors
1 parent 3af46ec commit f5eb12d

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

src/helpers/color.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,33 @@ function getHsla(hue: number, opacity: number | string = 1): string {
44

55
const predefinedColorMap: Readonly<Record<string, string>> = {
66
"@octokit": "#ffffff",
7-
"@types/": "#0086e0",
7+
"@stylistic": "#f43f5e",
8+
"@types": "#0086e0",
89
"cspell": "#e67a64",
10+
"es-toolkit": "#3dd68c",
911
"esbuild": "#ffcf00",
1012
"eslint": "#b7b7ff",
1113
"neostandard": "#b7b7ff",
1214
"postcss": "#f44d27",
1315
"sass": "#cc6699",
1416
"scss": "#cc6699",
17+
"storybook": "#ff4785",
1518
"stylelint": "#d0d5dd",
1619
"svelte": "#ff3e00",
17-
"ts-custom-error": "#0086e0",
18-
"tsconfig": "#0086e0",
19-
"tsdown": "#0086e0",
20-
"tslib": "#0086e0",
21-
"tsx": "#0086e0",
22-
"type-fest": "#0086e0",
23-
"typescript": "#0086e0",
20+
"ts": "#0086e0",
21+
"type": "#0086e0",
2422
"vite": "#9499ff",
2523
"vue": "#41b883",
2624
"workbox": "#ee810f"
2725
};
2826

27+
function normalizeName(name: string): string {
28+
if (name.startsWith("@")) return name.split("/")[0];
29+
return name;
30+
}
31+
2932
export function composeHashColor(name: string): string {
33+
name = normalizeName(name);
3034
const mapKey = Object.keys(predefinedColorMap).find((key) => name.includes(key));
3135
if (mapKey) return predefinedColorMap[mapKey];
3236

0 commit comments

Comments
 (0)