Badgy 是一个命令行工具,可以通过添加徽章覆盖层来创建图标的变体。
top, left, bottom, right, topLeft, topRight, bottomLeft, bottomRight, center
位置.appiconasset
,保持相同的名称和大小这个工具**不是**用于创建生产就绪的图标。由于我发现自己经常为 B2B 客户使用至少 4 个相同应用程序的变体(例如 DEV、QA、UAT、PROD 等环境),所以我快速创建了这个工具来区分这些变体的应用程序图标。
可能会有很多事情不如您预期,并且还有很多您希望它能做的事情。欢迎贡献项目并使其变得更好。
此工具依赖于 ImageMagick
。如果不是使用 brew
安装,请确保自行安装此依赖项
brew install imagemagick
brew tap arthurpalves/formulae
brew install badgy
mint install arthurpalves/badgy
git clone https://github.com/arthurpalves/badgy.git
cd badgy
make install
git clone https://github.com/arthurpalves/badgy.git
cd badgy
swift run badgy
Usage: badgy <command> [options]
A command-line tool to add labels to your app icon
Commands:
small Add small square label to app icon
long Add rectangular label to app icon
help Prints help information
version Prints the current version of this app
短徽章是一个方形徽章,仅包含 1 个字符。
Usage: badgy small <char> <icon> [options]
Add small square label to app icon
Options:
-c, --color <value> Specify badge color with a hexadecimal color code
-h, --help Show help information
-p, --position <value> Position on which to place the badge
-r, --replace Indicates Badgy should replace the input icon
-t, --tint-color <value> Specify badge text/tint color with a hexadecimal color code
-v, --verbose Log tech details for nerds
badgy small A ~/MyIcon.png --position topRight
长徽章是一个矩形徽章,最多包含 4 个字符。
Usage: badgy long <labelText> <icon> [options]
Add rectangular label to app icon
Options:
-a, --angle <value> Rotation angle of the badge
-c, --color <value> Specify badge color with a hexadecimal color code
-h, --help Show help information
-p, --position <value> Position on which to place the badge
-r, --replace Indicates Badgy should replace the input icon
-t, --tint-color <value> Specify badge text/tint color with a hexadecimal color code
-v, --verbose Log tech details for nerds
badgy long BETA ~/MyIcon.png --angle 15 --position bottom
您可以使用 -c, --color
和 -t, -tint-color
更改徽章颜色和色调/文本颜色。如果未指定,如上面的示例中所示,徽章颜色是随机选择的,而色调颜色始终为白色。
badgy long TEST ~/MyIcon.png --angle 15 --position bottom --color '#FFD700' --tint-color '#8B7500'
如果您喜欢人类可读的颜色格式,请查看 支持的命名颜色 的完整列表。
您的输入图标的可接受格式为:.png
、.jpg
和 .appiconasset
。如果使用后者,Badgy 将在 asset 中找到最大的可用图像作为输入。
Replace 是一个标志,您可以将其与您的 .appiconasset
输入一起使用,它将迭代 asset 中所有可用的图像并将最大的图标转换为相应的大小,这允许 Badgy 保持相同数量的文件、相同的名称和相同的大小。
✅ 非常适合任何图标集 -> iOS、iPadOS、tvOS、macOS
badgy long TEST MyProjectSource/Assets.xcassets/AppIcon.appiconasset --angle 15 --position bottom --replace
Badgy 在 MIT 许可证下发布。有关更多信息,请参阅 LICENSE。