Skip to content

Commit

Permalink
Tweak svg files (#290)
Browse files Browse the repository at this point in the history
* Tweak svg files

* Tweak

* More tweaks

* whatever

* whatever
  • Loading branch information
pokey authored Oct 7, 2021
1 parent 7212b22 commit d31239d
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion images/hats/bolt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/crosshairs.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/curve.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/default.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/ex.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/eye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/fox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/frame.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/hole.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/play.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion images/hats/wing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/scripts/preprocessSvgHats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ async function main() {
const rawSvg = await fsp.readFile(filePath, { encoding: "utf8" });
const svgJson = parser.parse(rawSvg, { ignoreAttributes: false });

svgJson.svg["@_width"] = "0.7em";
svgJson.svg["@_height"] = "0.7em";
svgJson.svg["@_width"] = "1em";
svgJson.svg["@_height"] = "1em";

if (
rawSvg.match(/fill="[^"]+"/) == null &&
Expand All @@ -27,8 +27,8 @@ async function main() {

const outputSvg = dumper
.parse(svgJson)
.replace(/fill="[^"]+"/, `fill="black"`)
.replace(/fill:[^;]+;/, `fill:black;`);
.replace(/fill="[^"]+"/, `fill="#666666"`)
.replace(/fill:[^;]+;/, `fill:#666666;`);

await fsp.writeFile(filePath, outputSvg);
});
Expand Down

0 comments on commit d31239d

Please sign in to comment.