Skip to content

Commit 03d947d

Browse files
committed
feat: generate icons as 16×16
1 parent 94f4063 commit 03d947d

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

src/core/generator/fileGenerator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ export const generateFileIcons = async (
238238
}
239239

240240
const fileIcon =
241-
'M13 9h5.5L13 3.5V9M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m5 2H6v16h12v-9h-7V4z';
241+
'M9 2v3h3Zm4 2.5V14q0 1-1 1H4q-1 0-1-1V2q0-1 1-1h5.5ZM8 2H4v12h8V6H8Z';
242242

243243
await writeSVGFiles(
244244
'file',
245-
getSVG(getPath(fileIcon, color), 24),
245+
getSVG(getPath(fileIcon, color)),
246246
opacity,
247247
saturation
248248
);

src/core/generator/folderGenerator.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,9 @@ export const generateFolderIcons = async (
450450
}
451451

452452
const folderIcon =
453-
'M13.84376,7.53645l-1.28749-1.0729A2,2,0,0,0,11.27591,6H4A2,2,0,0,0,2,8V24a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2H15.12412A2,2,0,0,1,13.84376,7.53645Z';
453+
'm6.922 3.768-.644-.536A1 1 0 0 0 5.638 3H2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H7.562a1 1 0 0 1-.64-.232';
454454
const folderIconOpen =
455-
'M28.96692,12H9.44152a2,2,0,0,0-1.89737,1.36754L4,24V10H28a2,2,0,0,0-2-2H15.1241a2,2,0,0,1-1.28038-.46357L12.5563,6.46357A2,2,0,0,0,11.27592,6H4A2,2,0,0,0,2,8V24a2,2,0,0,0,2,2H26l4.80523-11.21213A2,2,0,0,0,28.96692,12Z';
455+
'M7.242 3H2.36a.5.5 0 0 0-.474.342L1 6V2.5h6a.5.5 0 0 0-.5-.5H3.781a.5.5 0 0 1-.32-.116l-.322-.268a.5.5 0 0 0-.32-.116H1a.5.5 0 0 0-.5.5v4a.5.5 0 0 0 .5.5h5.5l1.202-2.803A.5.5 0 0 0 7.242 3';
456456

457457
await writeSVGFiles(
458458
'folder',
@@ -484,20 +484,18 @@ export const generateRootFolderIcons = async (
484484
return logger.error('Invalid color code for root folder icons');
485485
}
486486

487-
const rootFolderIcon =
488-
'M16,5A11,11,0,1,1,5,16,11.01245,11.01245,0,0,1,16,5m0-3A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,8a6,6,0,1,0,6,6A6,6,0,0,0,16,10Z';
489-
const rootFolderIconOpen =
490-
'M16,5A11,11,0,1,1,5,16,11.01245,11.01245,0,0,1,16,5m0-3A14,14,0,1,0,30,16,14,14,0,0,0,16,2Z';
487+
const rootFolderIconOuter = `<circle cx="8" cy="8" r="6" fill="none" stroke="${color}" stroke-width="2"/>`;
488+
const rootFolderIconInner = `<circle cx="8" cy="8" r="3" fill="${color}"/>`;
491489

492490
await writeSVGFiles(
493491
'folder-root',
494-
getSVG(getPath(rootFolderIcon, color)),
492+
getSVG(rootFolderIconOuter + rootFolderIconInner),
495493
opacity,
496494
saturation
497495
);
498496
await writeSVGFiles(
499497
'folder-root-open',
500-
getSVG(getPath(rootFolderIconOpen, color)),
498+
getSVG(rootFolderIconOuter),
501499
opacity,
502500
saturation
503501
);

src/core/generator/shared/svg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ export const writeSVGFiles = async (
2828
export const getPath = (d: string, color: string) =>
2929
`<path d="${d}" fill="${color}" />`;
3030

31-
export const getSVG = (path: string, viewBoxSize = 32) =>
31+
export const getSVG = (path: string, viewBoxSize = 16) =>
3232
`<svg viewBox="0 0 ${viewBoxSize} ${viewBoxSize}" xmlns="http://www.w3.org/2000/svg">${path}</svg>`;

0 commit comments

Comments
 (0)