File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,29 +4,33 @@ function getHsla(hue: number, opacity: number | string = 1): string {
44
55const 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+
2932export 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
You can’t perform that action at this time.
0 commit comments