Skip to content

Commit

Permalink
♻️ Add default scale
Browse files Browse the repository at this point in the history
  • Loading branch information
AnoyiX committed Oct 18, 2022
1 parent 10084dd commit 320d4c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
# ✨ Features

<h3 align="center">Icons for Developer, Powered by DETA ⚡</h3>

<hr>

# Features

- [Features](#features)
- [Design](#design)
- [Customization](#customization)
- [✨ Features](#-features)
- [🎨 Design](#-design)
- [🧪 Customization](#-customization)
- [icons](#icons)
- [cols](#cols)
- [iconBgColor](#iconbgcolor)
- [Icons List](#icons-list)

# Design
- [🎉 Icons List](#-icons-list)

I use Figma to design all icons. Each icon size is `256 x 256`, radius is `56`, inline verctor max width or height is `200`, recomended value is `180`.
# 🎨 Design

> 🎨 Figma Resource [https://www.figma.com/file/9MzhQygAIiTlJj79UbpBHK/DevIcons](https://www.figma.com/file/9MzhQygAIiTlJj79UbpBHK/DevIcons)
See all icons in [Figma](https://www.figma.com/file/9MzhQygAIiTlJj79UbpBHK/DevIcons).

# Customization
# 🧪 Customization

## icons

Expand Down Expand Up @@ -56,7 +49,7 @@ Change the `&iconBgColor=F3F4F6` to fill a rect to each icon.

[![](https://icons.anoyi.com/?iconBgColor=F3F4F6&icons=python,java,docker,kubernetes,html5,css3)](https://anoyi.com/dev-icons)

# Icons List
# 🎉 Icons List

Please visite [https://anoyi.com/dev-icons](https://anoyi.com/dev-icons) to see all icons with names.

Expand Down
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
GAP = 48
ICON_SIZE = 256 + GAP
PADDING = 0
SCALE = 48 / 256

# svg files
FILES = os.listdir('./icons')
Expand All @@ -22,7 +23,9 @@ def generate_svg(icon_names, cols, iconBgColor):
icon_bg_rect = f'<rect xmlns="http://www.w3.org/2000/svg" width="256" height="256" rx="56" fill="#{iconBgColor}"/>' if iconBgColor else ''
return f"""
<svg width="{width}" height="{height}" viewBox="0 0 {width} {height}" xmlns="http://www.w3.org/2000/svg" version="1.1">
<g transform="scale({SCALE})">
{''.join([f'<g transform="translate({(index % cols) * ICON_SIZE + PADDING}, {math.floor(index / cols) * ICON_SIZE + PADDING})">{icon_bg_rect}{icon}</g>' for index, icon in enumerate(svgs)])}
</g>
</svg>
""".strip()

Expand Down

0 comments on commit 320d4c4

Please sign in to comment.