-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Icon,licence, and some general maintenance
- Loading branch information
1 parent
1b6e9ed
commit 3a806ee
Showing
10 changed files
with
180 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Base: indigo | ||
Outline: orchid1 | ||
Glow: DarkViolet |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/bash | ||
prog=$(basename $0) | ||
version="1.0" | ||
|
||
# Default Colors | ||
|
||
color="white" | ||
outline="black" | ||
shade_color="white" | ||
|
||
|
||
function help() | ||
{ | ||
echo "$prog Version: $version" | ||
echo "By: Ryan Hagelstrom" | ||
echo "Description: Converts svg files to FG icon format" | ||
echo "Requires: imagemagick" | ||
echo "Syntax: $prog -i <image.svg>" | ||
echo | ||
echo " -h Help" | ||
echo " -i <image> SVG image file to convert (required)" | ||
echo " -b <color> Base color" | ||
echo " -o <color> Outline color" | ||
echo " -g <color> Glow color" | ||
exit | ||
} | ||
|
||
function iconify() | ||
{ | ||
unamestr=$(uname) | ||
if [[ "$unamestr" == 'Linux' ]]; then | ||
convert="./magick" | ||
else | ||
convert="convert" | ||
fi | ||
|
||
if [ -n "$filename" ] && [[ $filename == *.svg ]]; then | ||
filename_stripped="${filename%.svg}" | ||
filename_png="$filename_stripped" | ||
filename_png+=".png" | ||
filename_webp="$filename_stripped" | ||
filename_webp+="-forge.webp" | ||
filename_webp_sm="$filename_stripped" | ||
filename_webp_sm+=".webp" | ||
|
||
echo " Converting $filename $filename_png" | ||
|
||
"$convert" -background none "$filename" "$filename_png" | ||
|
||
# Color the image | ||
"$convert" "$filename_png" -background none -channel RGB -fuzz 50% -fill "$color" -colorize 100 -alpha on "$filename_png" | ||
|
||
# Resize bigger to fit the halos. Add outline under the edges and slight blur | ||
"$convert" "$filename_png" -background none -gravity center -extent '125%' -write mpr:input -fill "$outline" -channel RGB -colorize 100 +channel -morphology dilate:4 disk -blur 0x3 mpr:input -composite "$filename_png" | ||
|
||
# Add halow glow under the black with more blur | ||
"$convert" "$filename_png" -write mpr:input -fill "$shade_color" -channel RGB -colorize 100 +channel -morphology dilate:5 disk -blur 0x10 mpr:input -composite -resize 150x150 -quality 50 -define webp:lossless=true "$filename_webp" | ||
|
||
# Reduce size 30x30 for chat output | ||
"$convert" "$filename_png" -write mpr:input -fill "$shade_color" -channel RGB -colorize 100 +channel -morphology dilate:5 disk -blur 0x10 mpr:input -composite -resize 30x30 -quality 50 -define webp:lossless=true "$filename_webp_sm" | ||
|
||
rm "$filename_png" | ||
else | ||
help | ||
fi | ||
} | ||
while getopts i:b:o:g: flag | ||
do | ||
case "${flag}" in | ||
i) filename=${OPTARG};; | ||
b) color=${OPTARG};; | ||
o) outline=${OPTARG};; | ||
g) shade_color=${OPTARG};; | ||
*) help ;; | ||
esac | ||
done | ||
|
||
iconify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021-2024 Ryan Hagelstrom | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters