Skip to content

Commit

Permalink
Generate and check-in icons
Browse files Browse the repository at this point in the history
Checking in icons is not super pretty git practice, but when rendering
through GitHub, that's the easiest option
  • Loading branch information
chrysn committed Sep 12, 2024
1 parent 05f1c89 commit bf97a71
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
Binary file added .icons/app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .icons/app.png.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-License-Identifier: CC-BY-3.0
SPDX-License-CopyrightText: delapouite
Original file from https://game-icons.net/1x1/delapouite/keyboard.html
Binary file added .icons/board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions .icons/board.png.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-License-Identifier: CC-BY-3.0
SPDX-License-CopyrightText: lorc
Original file from https://game-icons.net/1x1/lorc/circuitry.html
23 changes: 23 additions & 0 deletions .icons/rebuild.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: chrysn <[email protected]>
# /// script
# dependencies = ["cairosvg"]
# ///

import urllib.request
import cairosvg

game_icons = {
"board": ("lorc", "circuitry"),
"app": ("delapouite", "keyboard"),
}

for (outname, (author, iconname)) in game_icons.items():
svg = urllib.request.urlopen(f"https://game-icons.net/icons/ffffff/000000/1x1/{author}/{iconname}.svg").read()
outname = outname + ".png"
cairosvg.svg2png(bytestring=svg, write_to=outname, output_width=20, output_height=20)
with open(outname + ".license", "w") as licensefile:
print("SPDX-License-Identifier: CC-BY-3.0", file=licensefile)
print(f"SPDX-License-CopyrightText: {author}", file=licensefile)
print(f"Original file from https://game-icons.net/1x1/{author}/{iconname}.html", file=licensefile)

0 comments on commit bf97a71

Please sign in to comment.