Added png and jpg support, refactored code.
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
res/demo.mp4
|
||||
packs/
|
||||
packs/papirus-mini_*
|
||||
*.egg-info/
|
||||
__pycache__/
|
||||
|
||||
3
.vscode/settings.json
vendored
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"python.analysis.typeCheckingMode": "off"
|
||||
}
|
||||
@@ -4,28 +4,26 @@
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk
|
||||
import os, ngtk
|
||||
import recolor as rc
|
||||
from PIL import Image
|
||||
import os, ngtk, utils
|
||||
|
||||
def recolor(src_path, dest_path, name, replacement, progress_bar):
|
||||
def recolor(src_path, dest_path, name, replacement, progress_bar, status):
|
||||
"""Recursively copies and converts a source folder into a destination, given a either a color or a palette."""
|
||||
|
||||
is_mono, new_colors = rc.get_input_colors(replacement)
|
||||
dest_path = rc.copy_pack(src_path, dest_path, name)
|
||||
vector_paths = rc.get_paths(dest_path, [".svg"])
|
||||
raster_paths = rc.get_paths(dest_path, [".png", ".jpeg"])
|
||||
is_mono, new_colors = utils.get_input_colors(replacement)
|
||||
dest_path = utils.copy_pack(src_path, dest_path, name)
|
||||
svg_paths = utils.get_paths(dest_path, [".svg"])
|
||||
img_paths = utils.get_paths(dest_path, [".png", ".jpg", ".jpeg"])
|
||||
|
||||
n = len(vector_paths); i = 0
|
||||
for path in vector_paths:
|
||||
n = len(svg_paths); i = 0
|
||||
for path in svg_paths:
|
||||
with open(path, 'r') as file:
|
||||
svg = file.read()
|
||||
|
||||
colors = rc.get_svg_colors(svg)
|
||||
colors = utils.get_svg_colors(svg)
|
||||
|
||||
if is_mono:
|
||||
svg = rc.monochrome_svg(svg, colors, new_colors)
|
||||
else:
|
||||
svg = rc.multichrome_svg(svg, colors, new_colors)
|
||||
if is_mono: svg = utils.monochrome_svg(svg, colors, new_colors)
|
||||
else: svg = utils.multichrome_svg(svg, colors, new_colors)
|
||||
|
||||
with open(path, 'w') as file:
|
||||
file.write(svg)
|
||||
@@ -35,6 +33,24 @@ def recolor(src_path, dest_path, name, replacement, progress_bar):
|
||||
while Gtk.events_pending():
|
||||
Gtk.main_iteration()
|
||||
|
||||
status.set_text("SVGs completed! Continuing...")
|
||||
|
||||
n = len(img_paths); i = 0
|
||||
for path in img_paths:
|
||||
img = Image.open(path)
|
||||
|
||||
if is_mono: img = utils.monochrome_img(img, new_colors)
|
||||
# else: multichrome_img(img, new_colors) # too slow.
|
||||
|
||||
img.save(path)
|
||||
|
||||
i = i + 1
|
||||
progress_bar.set_fraction(i/n)
|
||||
while Gtk.events_pending():
|
||||
Gtk.main_iteration()
|
||||
|
||||
status.set_text("Finished!")
|
||||
|
||||
class Window(Gtk.Window):
|
||||
def __init__(self):
|
||||
super().__init__(title="Color Manager")
|
||||
@@ -83,14 +99,15 @@ class Window(Gtk.Window):
|
||||
shared.add(gen_area)
|
||||
|
||||
def on_custom_palette_set(self, btn, palette_desc):
|
||||
self.palette = rc.load_palette_file(btn.get_filename())
|
||||
self.palette = utils.load_palette_file(btn.get_filename())
|
||||
palette_desc.set_text(self.palette["name"] + ": " + self.palette["desc"])
|
||||
|
||||
def on_palette_set(self, palette_picker, palette_desc):
|
||||
self.palette = rc.load_palette_file(palette_picker.choice)
|
||||
self.palette = utils.load_palette_file(palette_picker.choice)
|
||||
palette_desc.set_text(self.palette["name"] + ": " + self.palette["desc"])
|
||||
|
||||
def on_generate(self, btn):
|
||||
|
||||
if self.files.source is None:
|
||||
self.status.set_text("Choose a source folder first")
|
||||
return
|
||||
@@ -109,22 +126,22 @@ class Window(Gtk.Window):
|
||||
self.status.set_text("Choose a base color")
|
||||
return
|
||||
else:
|
||||
btn.set_sensitive(False)
|
||||
self.status.set_text("Generating " + self.files.name + " variant from " + os.path.basename(self.files.source) + "...")
|
||||
|
||||
recolor(self.files.source, self.files.destination, self.files.name, self.color_picker.color, self.progress_bar)
|
||||
|
||||
self.status.set_text("Success!")
|
||||
recolor(self.files.source, self.files.destination, self.files.name, self.color_picker.color, self.progress_bar, self.status)
|
||||
|
||||
elif current_page == 1:
|
||||
if self.palette is None:
|
||||
self.status.set_text("Choose a color palette file")
|
||||
return
|
||||
else:
|
||||
btn.set_sensitive(False)
|
||||
self.status.set_text("Generating " + self.files.name + " variant from " + os.path.basename(self.files.source) + " and " + os.path.basename(self.palette["name"]) + "...")
|
||||
|
||||
recolor(self.files.source, self.files.destination, self.files.name, self.palette, self.progress_bar)
|
||||
recolor(self.files.source, self.files.destination, self.files.name, self.palette, self.progress_bar, self.status)
|
||||
|
||||
self.status.set_text("Success!")
|
||||
btn.set_sensitive(True)
|
||||
|
||||
win = Window()
|
||||
win.connect("destroy", Gtk.main_quit)
|
||||
|
||||
@@ -252,9 +252,17 @@ def multichrome_svg(svg:str, colors:Set[str], new_colors:List[str]) -> str:
|
||||
return svg
|
||||
|
||||
def monochrome_img(img:Image, hsl:Tuple[float,float,float]) -> Image:
|
||||
"""Replace every instance of color within the given list with their
|
||||
monochrome equivalent in the given image, determined by the given hue, saturation and lightness offset."""
|
||||
|
||||
h, s, l_offset = hsl
|
||||
|
||||
if s != 0:
|
||||
if s == 0:
|
||||
if img.mode == "RGBA":
|
||||
img = img.convert("LA")
|
||||
else:
|
||||
img = img.convert("L")
|
||||
else:
|
||||
width, height = img.size
|
||||
l_offset = (l_offset - 0.5) * 2 # Remapping.
|
||||
|
||||
@@ -267,13 +275,35 @@ def monochrome_img(img:Image, hsl:Tuple[float,float,float]) -> Image:
|
||||
|
||||
l = (0.21*r + 0.72*g + 0.07*b)/255
|
||||
l = max(-1, min(l+l_offset, 1))
|
||||
new_color = hsl_to_rgb((h, s, l))
|
||||
|
||||
if img.mode == "RGBA":
|
||||
pixel = hsl_to_rgb((h, s, l)) + (a,)
|
||||
img.putpixel((x,y), new_color + (a,))
|
||||
else:
|
||||
pixel = hsl_to_rgb((h, s, l))
|
||||
img.putpixel((x,y), new_color)
|
||||
|
||||
img.putpixel((x,y), pixel)
|
||||
return img
|
||||
|
||||
def multichrome_img(img:str, new_colors:List[str]) -> Image:
|
||||
"""Replace colors in a given image with the closest match within a given
|
||||
color palette."""
|
||||
|
||||
width, height = img.size
|
||||
|
||||
for x in range(width):
|
||||
for y in range(height):
|
||||
if img.mode == "RGBA":
|
||||
r, g, b, a = img.getpixel((x, y))
|
||||
else:
|
||||
r, g, b = img.getpixel((x, y))
|
||||
|
||||
color = rgb_to_hex((r,g,b))
|
||||
new_color = hex_to_rgb(closest_match(color, new_colors))
|
||||
|
||||
if img.mode == "RGBA":
|
||||
img.putpixel((x,y), new_color + (a,))
|
||||
else:
|
||||
img.putpixel((x,y), new_color)
|
||||
|
||||
return img
|
||||
|
||||
@@ -284,28 +314,23 @@ def recolor(src_path:str, dest_path:str, name:str, replacement) -> None:
|
||||
dest_path = copy_pack(src_path, dest_path, name)
|
||||
svg_paths = get_paths(dest_path, [".svg"])
|
||||
img_paths = get_paths(dest_path, [".png", ".jpg", ".jpeg"])
|
||||
#jpg_paths = get_paths(dest_path, [".jpg", ".jpeg"])
|
||||
|
||||
for path in tqdm(svg_paths, desc="Processing svgs", unit=" file"):
|
||||
for path in tqdm(svg_paths, desc="Processing svgs", unit="file"):
|
||||
with open(path, 'r') as file:
|
||||
svg = file.read()
|
||||
|
||||
colors = get_svg_colors(svg)
|
||||
|
||||
if is_mono:
|
||||
svg = monochrome_svg(svg, colors, new_colors)
|
||||
else:
|
||||
svg = multichrome_svg(svg, colors, new_colors)
|
||||
if is_mono: svg = monochrome_svg(svg, colors, new_colors)
|
||||
else: svg = multichrome_svg(svg, colors, new_colors)
|
||||
|
||||
with open(path, 'w') as file:
|
||||
file.write(svg)
|
||||
|
||||
for path in tqdm(img_paths, desc="Processing imgs", unit=" file"):
|
||||
for path in tqdm(img_paths, desc="Processing imgs", unit="file"):
|
||||
img = Image.open(path)
|
||||
|
||||
if is_mono:
|
||||
img = monochrome_img(img, new_colors)
|
||||
else:
|
||||
pass
|
||||
if is_mono: img = monochrome_img(img, new_colors)
|
||||
# else: multichrome_img(img, new_colors) # too slow.
|
||||
|
||||
img.save(path)
|
||||
BIN
dist/color_manager_nv-0.1.0-py3-none-any.whl
vendored
BIN
dist/color_manager_nv-0.1.0.tar.gz
vendored
BIN
packs/test_pack/jpgs/lake_cabin.jpg
Normal file
|
After Width: | Height: | Size: 577 KiB |
1
packs/test_pack/links/firefox.svg
Symbolic link
@@ -0,0 +1 @@
|
||||
../svgs/firefox.svg
|
||||
BIN
packs/test_pack/pngs/account.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
packs/test_pack/pngs/colors.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
packs/test_pack/pngs/firefox.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
packs/test_pack/pngs/git.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
packs/test_pack/pngs/video.png
Normal file
|
After Width: | Height: | Size: 6.2 KiB |
BIN
packs/test_pack/pngs/vscode.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
7
packs/test_pack/svgs/account.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" version="1">
|
||||
<circle fill="#009587" cx="24" cy="24" r="20"/>
|
||||
<path fill="#fff" opacity=".2" d="m24 4a20 20 0 0 0 -20 20 20 20 0 0 0 0.0215 0.582 20 20 0 0 1 19.978 -19.582 20 20 0 0 1 19.979 19.418 20 20 0 0 0 0.021 -0.418 20 20 0 0 0 -20 -20z"/>
|
||||
<path opacity=".2" d="m43.979 24.418a20 20 0 0 1 -19.979 19.582 20 20 0 0 1 -19.978 -19.418 20 20 0 0 0 -0.022 0.418 20 20 0 0 0 20 20 20 20 0 0 0 20 -20 20 20 0 0 0 -0.021 -0.582z"/>
|
||||
<path style="opacity:0.2" d="m 24,12 c -2.762,0 -5,2.239 -5,5 0,2.761 2.238,5 5,5 2.762,0 5,-2.239 5,-5 0,-2.761 -2.238,-5 -5,-5 z m 0,13 c -9.999,0.006 -10,6.4 -10,6.4 V 34 c 0,0 1.846142,4 10,4 8.153858,0 10,-4 10,-4 v -2.6 c 0,0 0,-6.404 -9.998,-6.4 z"/>
|
||||
<path style="fill:#ffffff" d="m 24,11 c -2.762,0 -5,2.239 -5,5 0,2.761 2.238,5 5,5 2.762,0 5,-2.239 5,-5 0,-2.761 -2.238,-5 -5,-5 z m 0,13 c -9.999,0.006 -10,6.4 -10,6.4 V 33 c 0,0 1.846142,4 10,4 8.153858,0 10,-4 10,-4 v -2.6 c 0,0 0,-6.404 -9.998,-6.4 z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1023 B |
13
packs/test_pack/svgs/colors.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" version="1">
|
||||
<path id="ellipse856" style="opacity:0.2" d="M 23.995798,5 A 9.2852572,10 0 0 0 15.56597,10.841797 10.252114,9.0569205 23.678628 0 0 6.1280798,15 10.252114,9.0569205 23.678628 0 0 7.1322355,25 9.0569205,10.252114 66.321372 0 0 6.1280798,35 9.0569205,10.252114 66.321372 0 0 15.56597,39.160156 9.2852572,10 0 0 0 23.995798,45 9.2852572,10 0 0 0 32.429533,39.158203 C 36.360648,39.66891 40.046421,38.044553 41.86547,35 c 1.888239,-3.169465 1.338746,-7.107699 -1.049089,-10.068359 0.01668,0.02068 0.03625,0.03977 0.05275,0.06055 A 9.0569201,10.252114 66.32137 0 0 41.86547,15 9.0569201,10.252114 66.32137 0 0 34.144802,10.744141 9.0569201,10.252114 66.32137 0 0 32.429533,10.841797 9.2852572,10 0 0 0 23.995798,5 Z m 4.292081,7.205078 a 9.0569201,10.252114 66.32137 0 1 0.002,0 9.0569201,10.252114 66.32137 0 0 0,0.002 9.0569201,10.252114 66.32137 0 0 -0.77363,0.478516 9.0569201,10.252114 66.32137 0 1 0.771676,-0.480469 z m -1.08816,0.705078 a 9.0569201,10.252114 66.32137 0 0 -0.498171,0.373047 9.0569201,10.252114 66.32137 0 1 0.498171,-0.373047 z m -0.830284,0.658203 a 9.0569201,10.252114 66.32137 0 0 -0.408305,0.367188 9.0569201,10.252114 66.32137 0 1 0.408305,-0.367188 z m -0.738466,0.707032 a 9.0569201,10.252114 66.32137 0 0 -0.363371,0.392578 9.0569201,10.252114 66.32137 0 1 0.363371,-0.392578 z m -0.656413,0.755859 a 9.0569201,10.252114 66.32137 0 0 -0.318438,0.417969 9.0569201,10.252114 66.32137 0 1 0.318438,-0.417969 z m -0.57436,0.804688 a 9.0569201,10.252114 66.32137 0 0 -0.27546,0.439453 9.0569201,10.252114 66.32137 0 1 0.27546,-0.439453 z m 14.108971,6.955078 c 0.05651,0.03914 0.108574,0.08113 0.164104,0.121093 -0.05551,-0.03989 -0.107621,-0.08202 -0.164104,-0.121093 z m 0.836146,0.638672 c 0.09217,0.07749 0.176746,0.160394 0.265691,0.240234 -0.0891,-0.07985 -0.173355,-0.162741 -0.265691,-0.240234 z m 0.769722,0.714843 c 0.07384,0.07517 0.141743,0.153657 0.212944,0.230469 -0.07119,-0.07672 -0.139106,-0.15539 -0.212944,-0.230469 z m -16.039139,0.859375 c 0.33894,0.0031 0.672853,0.02712 1.002202,0.06836 -0.01026,-0.0013 -0.02099,-7.06e-4 -0.03126,-0.002 a 9.2852572,10 0 0 0 -0.970944,-0.06641 z m 1.291337,0.117188 c 0.158445,0.02533 0.318998,0.04429 0.474727,0.07813 0.09054,0.01967 0.178084,0.04782 0.267644,0.07031 -0.01344,-0.0034 -0.02756,-0.0045 -0.04103,-0.0078 a 9.2852572,10 0 0 0 -0.226618,-0.0625 9.2852572,10 0 0 0 -0.427841,-0.06836 c -0.01583,-0.0026 -0.03103,-0.0072 -0.04689,-0.0098 z m 1.08816,0.24414 c 0.230719,0.06817 0.45669,0.145961 0.679857,0.232422 -0.02687,-0.01042 -0.05507,-0.01718 -0.08205,-0.02734 a 9.2852572,10 0 0 0 -0.550918,-0.189453 c -0.01584,-0.0048 -0.03101,-0.01093 -0.04689,-0.01563 z m 0.988526,0.353516 c 0.254081,0.109604 0.501915,0.232766 0.744326,0.365234 -0.04312,-0.02358 -0.08934,-0.04158 -0.132845,-0.06445 a 9.2852572,10 0 0 0 -0.576315,-0.283203 c -0.01201,-0.0052 -0.02313,-0.01238 -0.03517,-0.01758 z m 0.927966,0.460938 c 0.02555,0.01473 0.05078,0.02994 0.07619,0.04492 0.267619,0.157795 0.526751,0.329199 0.777536,0.513672 a 9.2852572,10 0 0 0 -0.777536,-0.513672 9.2852572,10 0 0 0 -0.04493,-0.02344 c -0.01092,-0.0064 -0.02032,-0.01517 -0.03126,-0.02148 z m 1.000248,0.675781 c 0.197277,0.151309 0.392864,0.305599 0.578269,0.472656 a 9.2852572,10 0 0 0 -0.578269,-0.472656 z m 0.908429,0.798828 c 0.108201,0.107411 0.218991,0.211441 0.322346,0.324219 a 9.2852572,10 0 0 0 -0.294995,-0.294922 9.2852572,10 0 0 0 -0.02735,-0.0293 z m 0.713068,0.785156 c 0.07668,0.09478 0.1552,0.187289 0.228572,0.285156 a 9.2852572,10 0 0 0 -0.191454,-0.232421 c -0.01336,-0.01675 -0.02365,-0.03608 -0.03712,-0.05273 z m 0.42198,0.566406 c 0.02139,0.03066 0.0434,0.06086 0.06447,0.0918 -0.0092,-0.01351 -0.02004,-0.02561 -0.0293,-0.03906 a 9.2852572,10 0 0 0 -0.03516,-0.05273 z m 0.160195,0.240235 a 9.0569201,10.252114 66.32137 0 0 0.0078,0 c 0.0619,0.09449 0.124741,0.188291 0.18364,0.285156 a 9.2852572,10 0 0 0 -0.191454,-0.285156 z m 0.347743,0.566406 c 0.107239,0.18962 0.213076,0.380489 0.30867,0.578125 A 9.2852572,10 0 0 0 31.923548,29.8125 Z m 0.429795,0.847656 c 0.09413,0.209767 0.183101,0.42106 0.263737,0.638672 a 9.2852572,10 0 0 0 -0.263737,-0.638672 z m 0.355556,0.90625 c 0.07394,0.217485 0.145094,0.435898 0.205129,0.660156 a 9.2852572,10 0 0 0 -0.205129,-0.660156 z m 0.28132,0.986328 c 0.04859,0.20764 0.09458,0.416332 0.130892,0.628907 a 9.2852572,10 0 0 0 -0.130892,-0.628907 z m 0.187546,1.021485 c 0.02563,0.192771 0.0492,0.385876 0.06447,0.582031 a 9.2852572,10 0 0 0 -0.06447,-0.582031 z"/>
|
||||
<ellipse style="fill:#278df2" cx="23.999" cy="24" rx="16.503" ry="16"/>
|
||||
<ellipse id="ellipse8" style="fill:#34e0c4" cx="32.676" cy="-18.58" rx="9.072" ry="10.237" transform="matrix(0.51165103,0.85919336,-0.87259818,0.48843875,0,0)"/>
|
||||
<ellipse id="ellipse10" style="fill:#ffc107" cx="23.999" cy="34" rx="9.283" ry="10"/>
|
||||
<ellipse id="ellipse14" style="fill:#fb8300" cx="32.676" cy="1.893" rx="9.072" ry="10.237" transform="matrix(0.51165103,0.85919336,-0.87259818,0.48843875,0,0)"/>
|
||||
<ellipse id="ellipse18" style="fill:#fa3e30" cx="9.224" cy="22.675" rx="9.072" ry="10.237" transform="matrix(-0.51165103,0.85919336,0.87259818,0.48843875,0,0)"/>
|
||||
<path style="fill:#a544c9" d="M 23.998821,4 A 9.2829514,10 0 0 0 14.715869,14 9.2829514,10 0 0 0 23.998821,24 9.0565567,10.249979 66.278874 0 1 28.289767,11.205078 9.0565567,10.249979 66.278874 0 1 32.429625,9.841797 9.2829514,10 0 0 0 23.998821,4 Z m 0,20 A 9.2829514,10 0 0 0 32.822459,17.083984 9.2829514,10 0 0 1 31.575465,19.753906 10.249979,9.0565567 23.721126 0 0 23.998821,24 Z m 8.823638,-6.916016 a 9.2829514,10 0 0 0 0.223614,-0.882812 9.2829514,10 0 0 1 -0.223614,0.882812 z m -0.284048,-6.976562 a 9.2829514,10 0 0 1 0.310236,0.912109 9.2829514,10 0 0 0 -0.310236,-0.912109 z m 0.324339,0.953125 a 9.2829514,10 0 0 1 0.189367,0.791015 9.2829514,10 0 0 0 -0.189367,-0.791015 z m 0.241743,1.035156 a 9.2829514,10 0 0 1 0.09065,0.638672 9.2829514,10 0 0 0 -0.09065,-0.638672 z m 0.134974,1.037109 A 9.2829514,10 0 0 1 33.281772,14 a 9.2829514,10 0 0 0 -0.0423,-0.867188 z m 0.02215,1.308594 a 9.2829514,10 0 0 1 -0.04029,0.65625 9.2829514,10 0 0 0 0.04029,-0.65625 z m -0.07252,0.886719 a 9.2829514,10 0 0 1 -0.120872,0.775391 9.2829514,10 0 0 0 0.120872,-0.775391 z"/>
|
||||
<path style="fill:#009688" d="M 31.718497,19.744141 C 28.419739,19.834623 25.531065,21.427149 23.998821,24 c 5.126832,0 9.282951,4.477152 9.282951,10 -0.0036,1.435898 -0.294259,2.854115 -0.852147,4.158203 C 36.359764,38.66891 40.04507,37.044553 41.863667,34 44.427616,29.695265 42.506426,23.966581 37.572718,21.205078 35.772638,20.19784 33.732093,19.688616 31.718497,19.744141 Z m 0.711128,18.414062 z M 23.998821,24 Z"/>
|
||||
<path id="ellipse980" style="fill:#03a9f4" d="m 34.144999,9.7441405 a 9.0565567,10.249979 66.278874 0 0 -5.854727,1.4619145 9.0565567,10.249979 66.278874 0 0 -4.290948,12.793457 c 1.532334,-2.572508 4.420665,-4.164896 7.719173,-4.255372 2.013596,-0.05552 4.054141,0.4537 5.854221,1.460938 1.326219,0.742313 2.432505,1.700308 3.294765,2.786133 A 9.0565567,10.249979 66.278874 0 0 41.86417,14 9.0565567,10.249979 66.278874 0 0 34.144999,9.7441405 Z M 23.999324,24 a 9.0565567,10.249979 66.278874 0 0 7.590243,4.246582 C 29.90942,25.67887 27.137193,24.00018 23.999324,24 Z"/>
|
||||
<path style="fill:#ffc107" d="m 23.999324,23.999512 c -15.9995493,16.000325 -7.999775,8.000163 0,0 z m 0,4.88e-4 c 1.628754,3.233879 4.429558,4.634072 7.590243,4.246582 C 29.90942,25.67887 27.137193,24.00018 23.999324,24 Z"/>
|
||||
<path id="ellipse880" style="opacity:0.2;fill:#ffffff" d="M 23.998047,4 A 9.2829514,10 0 0 0 15.570312,9.8417969 10.249979,9.0565571 23.721124 0 0 6.1347656,14 10.249979,9.0565571 23.721124 0 0 5.03125,18.626953 10.249979,9.0565571 23.721124 0 1 6.1347656,15 10.249979,9.0565571 23.721124 0 1 15.570312,10.841797 9.2829514,10 0 0 1 23.998047,5 9.2829514,10 0 0 1 32.429688,10.841797 9.0565567,10.249979 66.278874 0 1 34.144531,10.744141 9.0565567,10.249979 66.278874 0 1 41.863281,15 9.0565567,10.249979 66.278874 0 1 42.972656,18.679688 9.0565567,10.249979 66.278874 0 0 41.863281,14 9.0565567,10.249979 66.278874 0 0 34.144531,9.7441406 9.0565567,10.249979 66.278874 0 0 32.429688,9.8417969 9.2829514,10 0 0 0 23.998047,4 Z m 4.291015,8.205078 a 9.0565567,10.249979 66.278874 0 0 -0.771484,0.480469 9.0565567,10.249979 66.278874 0 1 0.773438,-0.478516 9.0565567,10.249979 66.278874 0 0 0,-0.002 9.0565567,10.249979 66.278874 0 1 -0.002,0 z M 6.7773438,24.503906 a 9.0565571,10.249979 66.278876 0 0 -1.75,5.824219 A 9.0565571,10.249979 66.278876 0 1 7.1386719,25 10.249979,9.0565571 23.721124 0 1 6.7773438,24.503906 Z m 34.4394532,0.002 a 9.0565567,10.249979 66.278874 0 1 -0.349609,0.486329 c -0.01649,-0.02078 -0.03605,-0.03987 -0.05273,-0.06055 1.300335,1.612676 2.051174,3.515244 2.164063,5.425781 0.121382,-2.019743 -0.516337,-4.075037 -1.761719,-5.851563 z m -15.847656,0.615235 c 0.01585,0.0026 0.03105,0.0072 0.04687,0.0098 a 9.2829514,10 0 0 1 0.427734,0.06836 c -0.15569,-0.03384 -0.316203,-0.05279 -0.474609,-0.07813 z m 0.474609,0.07813 a 9.2829514,10 0 0 1 0.226562,0.0625 c 0.01347,0.0033 0.02758,0.0044 0.04102,0.0078 -0.08954,-0.02249 -0.177068,-0.05064 -0.267578,-0.07031 z m 2.529297,0.980469 c 0.01094,0.0063 0.02034,0.01508 0.03125,0.02148 a 9.2829514,10 0 0 1 0.04492,0.02344 c -0.0254,-0.01498 -0.05062,-0.03019 -0.07617,-0.04492 z m 2.621094,2.259765 c 0.01346,0.01665 0.02375,0.03599 0.03711,0.05273 a 9.2829514,10 0 0 1 0.191406,0.232421 C 31.149307,28.626786 31.070802,28.53428 30.994142,28.4395 Z m 0.421875,0.566406 a 9.2829514,10 0 0 1 0.03516,0.05273 c 0.0093,0.01345 0.0201,0.02555 0.0293,0.03906 -0.02106,-0.03094 -0.04306,-0.06114 -0.06445,-0.0918 z m 0.160156,0.240235 a 9.2829514,10 0 0 1 0.191406,0.285156 c -0.05888,-0.09687 -0.121704,-0.190666 -0.183594,-0.285156 a 9.0565567,10.249979 66.278874 0 1 -0.0078,0 z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 9.7 KiB |
13
packs/test_pack/svgs/firefox.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" version="1">
|
||||
<path style="opacity:0.2" d="M 11.383708,17.906948 C 6.7052449,21.524918 4.0000794,18.907513 4.0000794,25.233684 4.0000794,36.150319 12.954367,45 24.00004,45 c 11.045673,0 19.999961,-8.849681 19.999961,-19.766316 0,-5.082435 -1.940952,-9.716871 -5.130138,-13.218797 0.07109,-0.0027 -0.298242,-0.286613 -0.488646,-0.215756 1.333235,2.20987 2.10061,4.799539 2.10061,7.568618 0,8.103601 -4.506892,16.131621 -12.610494,16.131621 -5.204893,0.252643 -12.138384,-3.074806 -13.205552,-6.188504 -0.688507,-2.008872 -0.514713,-4.265085 1.358501,-5.51402 1.017468,-0.645877 2.500851,-1.283591 4.847679,-1.358478 2.143821,-1.409901 1.100715,-1.249529 0.997592,-1.676392 -0.665964,-0.182106 -1.848112,-0.433768 -3.480317,-1.718377 -1.445664,-1.137794 -2.117115,-1.569228 -6.330071,-1.608581 -0.795906,-1.532565 -0.597445,2.291652 -0.675457,0.47193 z"/>
|
||||
<path style="fill:#ffde3f" d="m 30.289276,2 c 0.84367,2.2459536 3.894602,5.7139707 7.91874,10.867919 3.408058,4.364899 3.79864,9.234865 5.058537,13.613523 L 33.796774,34.632048 23.1,23.651007 C 23.051967,16.350832 21.299767,8.1097516 30.289276,2 Z"/>
|
||||
<path style="opacity:0.2;fill:#ffffff" d="M 30.289062 2 C 23.743731 6.4485575 22.897697 12.026343 22.9375 17.548828 C 23.017579 12.35744 24.138867 7.1800024 30.289062 3 C 31.132732 5.2459536 34.184846 8.7132392 38.208984 13.867188 C 41.408265 17.964693 41.954357 22.502597 43.050781 26.666016 L 43.265625 26.480469 C 42.005728 22.101811 41.617042 17.232087 38.208984 12.867188 C 34.184846 7.7132392 31.132732 4.2459536 30.289062 2 z"/>
|
||||
<path style="fill:#ff750e" d="m 10.956404,15.714003 c 1.389334,-1.378591 3.657964,-4.58869 6.364796,-5.478559 -0.727223,3.876168 0.215559,5.108162 0.68482,7.089899 L 13.6554,16.197404 Z"/>
|
||||
<circle style="fill:#8357cd" cx="24" cy="24" r="10"/>
|
||||
<path style="fill:#ffba36" d="m 27.738872,17.234756 c -0.14224,0.0014 -0.284421,0.0064 -0.426401,0.01515 2.896203,1.359555 4.747167,4.268975 4.751377,7.468407 -0.0022,4.395846 -3.445862,8.12077 -7.835848,8.347687 1.097729,0.519415 2.296463,0.690057 3.510872,0.693439 4.563161,4.1e-5 8.262372,-3.699089 8.262432,-8.26225 4.1e-5,-4.563232 -3.6992,-8.262474 -8.262432,-8.262433 z"/>
|
||||
<path id="ellipse841" style="fill:#f74e66" d="M 11.383708,16.906948 C 6.7052449,20.524918 4.0000794,17.907513 4.0000794,24.233684 4.0000794,35.150319 12.954367,44 24.00004,44 c 11.045673,0 19.999961,-8.849681 19.999961,-19.766316 0,-5.082435 -1.940952,-9.716871 -5.130138,-13.218797 0.07109,-0.0027 -0.298242,-0.286613 -0.488646,-0.215756 1.333235,2.20987 2.10061,4.799539 2.10061,7.568618 0,8.103601 -4.506892,16.131621 -12.610494,16.131621 -5.204893,0.252643 -12.138384,-3.074806 -13.205552,-6.188504 -0.688507,-2.008872 -0.514713,-4.265085 1.358501,-5.51402 1.017468,-0.645877 2.500851,-1.283591 4.847679,-1.358478 2.143821,-1.409901 1.100715,-1.249529 0.997592,-1.676392 -0.665964,-0.182106 -1.848112,-0.433768 -3.480317,-1.718377 -1.445664,-1.137794 -2.117115,-1.569228 -6.330071,-1.608581 -0.795906,-1.532565 -0.597445,2.291652 -0.675457,0.47193 z"/>
|
||||
<path style="opacity:0.1" d="M 11.685547,9.6582031 C 7.207349,13.121303 4.2675076,18.431553 4.0234375,24.427734 4.2795251,33.617002 12.667958,41 23,41 c 10.49341,0 19,-7.611159 19,-17 0,-2.530342 -0.622373,-4.929976 -1.730469,-7.087891 0.13486,0.799262 0.212891,1.617437 0.212891,2.455079 0,8.103601 -6.570226,14.673828 -14.673828,14.673828 -5.204893,0.252643 -9.120332,-2.62263 -10.1875,-5.736328 -0.688507,-2.008873 -0.463058,-2.856534 1.410156,-4.105469 1.017468,-0.645877 2.450047,-1.083316 4.796875,-1.158203 2.143821,-1.409901 2.308201,-1.952044 2.205078,-2.378907 -0.665964,-0.182106 -2.50256,-0.887266 -4.134765,-2.171875 C 18.452773,17.35244 16.625065,15.059353 12.412109,15.02 11.616203,13.487435 11.763559,11.477925 11.685547,9.6582031 Z"/>
|
||||
<path style="fill:#ff7f1f" d="M 11.685547,8.6582031 C 7.207349,12.121303 4.2675076,17.431553 4.0234375,23.427734 4.2795251,32.617002 12.667958,40 23,40 c 10.49341,0 19,-7.611159 19,-17 0,-2.530342 -0.622373,-4.929976 -1.730469,-7.087891 0.13486,0.799262 0.212891,1.617437 0.212891,2.455079 0,8.103601 -6.570226,14.673828 -14.673828,14.673828 -5.204893,0.252643 -9.120332,-2.62263 -10.1875,-5.736328 -0.688507,-2.008873 -0.463058,-2.856534 1.410156,-4.105469 1.017468,-0.645877 2.450047,-1.083316 4.796875,-1.158203 2.143821,-1.409901 2.308201,-1.952044 2.205078,-2.378907 -0.665964,-0.182106 -2.50256,-0.887266 -4.134765,-2.171875 C 18.452773,16.35244 16.625065,14.059353 12.412109,14.02 11.616203,12.487435 11.763559,10.477925 11.685547,8.6582031 Z"/>
|
||||
<path style="fill:#ffba36" d="m 12.9357,19.005753 c -1.361036,-0.02953 -2.79292,0.437222 -3.7030813,1.058337 -0.1630259,0.163026 1.5846873,3.114177 4.6265243,3.146167 -0.281634,4.906808 3.64122,7.958153 6.107245,8.668162 l 7.48e-4,-0.0022 c -6.54e-4,-3.36e-4 -0.0013,-7.57e-4 -0.002,-0.0011 -0.198719,-0.09852 -0.392011,-0.20212 -0.579913,-0.310492 -0.01757,-0.01013 -0.03492,-0.02046 -0.05239,-0.03067 -0.105035,-0.06141 -0.208263,-0.124265 -0.309761,-0.188559 -0.01987,-0.01258 -0.03977,-0.0251 -0.05951,-0.03778 -0.101593,-0.06536 -0.20127,-0.132129 -0.299174,-0.200241 -0.01536,-0.01068 -0.03091,-0.0212 -0.04618,-0.03194 -0.0562,-0.03957 -0.111895,-0.07948 -0.166837,-0.119925 -0.107747,-0.07932 -0.212772,-0.160441 -0.315602,-0.242953 -0.0244,-0.01957 -0.04853,-0.03922 -0.07265,-0.05896 -0.07283,-0.05964 -0.144418,-0.119914 -0.214661,-0.181075 -0.0342,-0.02975 -0.0681,-0.05971 -0.101672,-0.08981 -0.04875,-0.04374 -0.09695,-0.08771 -0.144384,-0.132155 -0.04584,-0.04291 -0.09122,-0.08605 -0.135806,-0.129599 -0.03679,-0.03597 -0.07322,-0.07205 -0.109156,-0.108426 -0.05223,-0.05283 -0.103661,-0.106046 -0.154059,-0.159718 -9.72e-4,-0.001 -0.0019,-0.0021 -0.0029,-0.0031 -0.03116,-0.03325 -0.06155,-0.06684 -0.092,-0.100394 -0.04291,-0.04724 -0.08519,-0.09473 -0.126678,-0.142559 -0.03267,-0.0377 -0.06496,-0.07549 -0.09674,-0.113537 -0.0423,-0.0506 -0.0836,-0.101598 -0.124306,-0.152781 -0.02296,-0.02889 -0.04619,-0.05764 -0.06863,-0.0867 -0.05105,-0.06606 -0.100384,-0.132756 -0.148766,-0.199693 -0.01927,-0.02668 -0.03847,-0.05332 -0.05732,-0.08013 -0.05029,-0.0715 -0.09919,-0.143377 -0.146393,-0.215756 -0.01289,-0.01978 -0.02531,-0.03967 -0.03797,-0.05951 -0.04692,-0.07349 -0.09265,-0.147139 -0.136353,-0.221415 -0.0093,-0.01573 -0.01828,-0.03152 -0.02738,-0.04728 -0.04404,-0.0762 -0.08607,-0.152901 -0.12668,-0.229812 -0.0075,-0.01426 -0.01541,-0.02843 -0.02282,-0.04271 -0.04242,-0.08177 -0.08253,-0.163979 -0.121021,-0.246422 -0.0081,-0.01727 -0.01603,-0.03454 -0.02391,-0.05184 -0.03768,-0.08262 -0.07367,-0.165453 -0.10733,-0.248613 -0.0053,-0.01318 -0.01028,-0.02642 -0.01552,-0.03961 -0.03511,-0.08849 -0.06863,-0.177179 -0.09912,-0.266135 -0.688507,-2.008872 -0.464411,-2.856635 1.408803,-4.10557 1.017468,-0.645877 2.450548,-1.082383 4.797376,-1.15727 2.143821,-1.409901 2.307959,-1.953755 2.204836,-2.380618 -3.61569,2.86611 -6.993136,0.422936 -10.173205,-0.551756 -0.299252,-0.06388 -0.60954,-0.09705 -0.923625,-0.103862 z"/>
|
||||
<path style="opacity:0.2;fill:#ffffff" d="M 11.685547 8.6582031 C 7.2073489 12.121303 4.2675076 17.431553 4.0234375 23.427734 C 4.0276636 23.579379 4.0519193 23.726317 4.0605469 23.876953 C 4.4572887 18.107952 7.3455683 13.014415 11.685547 9.6582031 C 11.763559 11.477925 11.616203 13.486966 12.412109 15.019531 C 16.625065 15.058884 18.452773 17.35244 19.898438 18.490234 C 21.337573 19.62289 22.888716 20.280416 23.703125 20.550781 C 24.046016 20.152973 24.087444 19.886632 24.033203 19.662109 C 23.367239 19.480003 21.530642 18.774843 19.898438 17.490234 C 18.452773 16.35244 16.625065 14.058884 12.412109 14.019531 C 11.616203 12.486966 11.763559 10.477925 11.685547 8.6582031 z M 40.269531 15.912109 C 40.343747 16.351957 40.39538 16.798604 40.431641 17.25 C 41.34452 19.133706 41.88958 21.191533 41.980469 23.355469 C 41.983234 23.236072 42 23.11999 42 23 C 42 20.469658 41.377627 18.070024 40.269531 15.912109 z M 40.458984 18.839844 C 40.207223 26.722744 33.752613 33.041016 25.808594 33.041016 C 20.603701 33.293659 16.688262 30.418385 15.621094 27.304688 C 15.475643 26.880303 15.381174 26.517109 15.324219 26.181641 C 15.204245 26.753204 15.314847 27.411144 15.621094 28.304688 C 16.688262 31.418385 20.603701 34.293659 25.808594 34.041016 C 33.912196 34.041016 40.482422 27.470789 40.482422 19.367188 C 40.482422 19.189395 40.465812 19.015887 40.458984 18.839844 z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.2 KiB |
8
packs/test_pack/svgs/git.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" version="1">
|
||||
<path style="opacity:0.2" d="m 23.99939,3.9999997 c -1.10005,0 -2.200835,0.4100214 -3.023149,1.2323158 L 4.2322781,21.978145 c -1.644629,1.644587 -1.642296,4.39682 0.0024,6.041409 L 20.978641,44.765383 c 1.644629,1.644589 4.399315,1.646922 6.043944,0.0024 L 43.766548,28.021955 c 1.644628,-1.644589 1.644629,-4.399178 0,-6.043766 L 27.022541,5.2323155 C 26.200227,4.4100212 25.099441,3.9999997 23.99939,3.9999997 Z"/>
|
||||
<path style="fill:#e3b56f" d="M 23.99939,3 C 22.89934,3 21.798555,3.4100214 20.976241,4.2323158 L 4.2322781,20.978145 c -1.644629,1.644587 -1.642296,4.39682 0.0024,6.041409 L 20.978641,43.765383 c 1.644629,1.644589 4.399315,1.646922 6.043944,0.0024 L 43.766548,27.021955 c 1.644628,-1.644589 1.644629,-4.399178 0,-6.043766 L 27.022541,4.2323158 C 26.200227,3.4100215 25.099441,3 23.99939,3 Z"/>
|
||||
<path style="opacity:0.5;fill:#ffffff" d="M 18.019125,7.191406 15.191,10.019531 20.999594,15.828125 V 30 h 4 V 19.828125 l 4.585938,4.585937 2.828124,-2.828124 z"/>
|
||||
<path style="opacity:0.2" d="m 22.999594,12 a 4,4 0 0 0 -4,4 4,4 0 0 0 4,4 4,4 0 0 0 4,-4 4,4 0 0 0 -4,-4 z m 8,8 a 4,4 0 0 0 -4,4 4,4 0 0 0 4,4 4,4 0 0 0 4,-4 4,4 0 0 0 -4,-4 z m -8,7 a 4,4 0 0 0 -4,4 4,4 0 0 0 4,4 4,4 0 0 0 4,-4 4,4 0 0 0 -4,-4 z"/>
|
||||
<path style="fill:#ffffff" d="m 22.999594,11 a 4,4 0 0 0 -4,4 4,4 0 0 0 4,4 4,4 0 0 0 4,-4 4,4 0 0 0 -4,-4 z m 8,8 a 4,4 0 0 0 -4,4 4,4 0 0 0 4,4 4,4 0 0 0 4,-4 4,4 0 0 0 -4,-4 z m -8,7 a 4,4 0 0 0 -4,4 4,4 0 0 0 4,4 4,4 0 0 0 4,-4 4,4 0 0 0 -4,-4 z"/>
|
||||
<path style="opacity:0.2;fill:#ffffff" d="M 24,3 C 22.89995,3 21.798876,3.4101275 20.976562,4.2324219 L 4.2324219,20.978516 C 3.2862751,21.924638 2.9037262,23.234678 3.046875,24.492188 3.1538236,23.568432 3.5371786,22.673741 4.2324219,21.978516 L 20.976562,5.2324219 C 21.798876,4.4101275 22.89995,4 24,4 c 1.100051,0 2.201124,0.4101276 3.023438,1.2324219 L 43.765625,21.978516 c 0.696999,0.696981 1.081282,1.594754 1.1875,2.521484 0.144413,-1.259969 -0.23987,-2.573878 -1.1875,-3.521484 L 27.023438,4.2324219 C 26.201124,3.4101276 25.100051,3 24,3 Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
13
packs/test_pack/svgs/video.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" version="1">
|
||||
<path fill="#9c27b0" d="m7 6c-1.662 0-3 1.338-3 3v25h40v-25c0-1.662-1.338-3-3-3z"/>
|
||||
<path fill="#fff" opacity=".2" d="m7 6c-1.662 0-3 1.338-3 3v1c0-1.662 1.338-3 3-3h34c1.662 0 3 1.338 3 3v-1c0-1.662-1.338-3-3-3h-34z"/>
|
||||
<path style="fill:#e4e4e4" d="m4 34v5c0 1.662 1.338 3 3 3h34c1.662 0 3-1.338 3-3v-5z"/>
|
||||
<rect fill="#999" width="13" height="2" x="28" y="37" rx="1" ry=".928"/>
|
||||
<rect fill="#9c27b0" width="21" height="2" x="7" y="37" rx="1" ry="1"/>
|
||||
<circle opacity=".2" cx="28" cy="39" r="2"/>
|
||||
<circle style="fill:#ffffff" cx="28" cy="38" r="2"/>
|
||||
<rect fill="#fff" style="opacity:0.2" width="40" height="1" x="4" y="34"/>
|
||||
<path opacity=".2" d="m18.59 14c-0.54357-0.01-0.63707 0.6466-0.59214 1.1206 0.004 4.4362-0.007 8.873 0.005 13.309 0.0478 0.5304 0.65436 0.74232 0.99922 0.41339 3.6857-2.2712 9.0468-4.5268 12.727-6.8078 0.40157-0.31396 0.24777-1.0451-0.20045-1.1971-3.6858-2.2622-9.0332-4.5368-12.722-6.7913-0.0689-0.0308-0.14295-0.0467-0.21704-0.0468z"/>
|
||||
<path style="fill:#ffffff" d="m18.59 13c-0.54357-0.01-0.63707 0.6466-0.59214 1.1206 0.004 4.4362-0.007 8.873 0.005 13.309 0.0478 0.5304 0.65436 0.74232 0.99922 0.41339 3.6857-2.2712 9.0468-4.5268 12.727-6.8078 0.40157-0.31396 0.24777-1.0451-0.20045-1.1971-3.6858-2.2622-9.0332-4.5368-12.722-6.7913-0.0689-0.0308-0.14295-0.0467-0.21704-0.0468z"/>
|
||||
<path opacity=".2" d="m4 39v1c0 1.662 1.338 3 3 3h34c1.662 0 3-1.338 3-3v-1c0 1.662-1.338 3-3 3h-34c-1.662 0-3-1.338-3-3z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
11
packs/test_pack/svgs/vscode.svg
Normal file
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" version="1">
|
||||
<path style="opacity:0.2" d="m 42.585238,9.2375782 -8.236691,-3.98884 c -0.953325,-0.46171 -2.092785,-0.26695 -2.841079,0.48562 L 4.5434118,30.162018 c -0.7252652,0.66515 -0.7244313,1.81357 0.0018,2.47762 l 2.2025103,2.01382 c 0.5937314,0.54296 1.4878888,0.58285 2.1271392,0.0952 L 41.345838,10.272378 c 1.089335,-0.8311898 2.654005,-0.0497 2.654005,1.32556 v -0.0962 c 0,-0.96537 -0.54982,-1.8453898 -1.414605,-2.2641698 z"/>
|
||||
<path style="opacity:0.2" d="m 34.349015,44.752347 c -0.953637,0.46128 -2.093097,0.26637 -2.841391,-0.48626 0.921938,0.92728 2.498475,0.27046 2.498475,-1.04099 v -36.4502 c 0,-1.31145 -1.576537,-1.96824 -2.498475,-1.0409 0.748294,-0.75263 1.887754,-0.94767 2.841391,-0.48637 l 8.235286,3.98336 C 43.44971,9.649547 44,10.529887 44,11.495677 v 27.00883 c 0,0.96576 -0.55029,1.84608 -1.415699,2.26464 z"/>
|
||||
<path style="fill:#0072b0" d="M 42.585238,8.23724 34.348547,4.2484 C 33.395222,3.78669 32.255762,3.98145 31.507468,4.73402 L 4.5434118,29.16168 c -0.7252652,0.66515 -0.7244313,1.81357 0.0018,2.47762 l 2.2025103,2.01382 c 0.5937314,0.54296 1.4878888,0.58285 2.1271392,0.0952 L 41.345838,9.27204 c 1.089335,-0.83119 2.654005,-0.0497 2.654005,1.32556 v -0.0962 c 0,-0.96537 -0.54982,-1.84539 -1.414605,-2.26417 z"/>
|
||||
<path style="opacity:0.1;fill:#ffffff" d="m 33.228516,4 c -0.63234,0.01048 -1.25302,0.2640188 -1.720704,0.734375 L 4.5429688,29.162109 c -0.4974825,0.456248 -0.6445383,1.13761 -0.4589844,1.736329 0.084912,-0.272382 0.2325864,-0.528696 0.4589844,-0.736329 L 31.507812,5.734375 c 0.748294,-0.75257 1.886519,-0.9480381 2.839844,-0.4863281 l 7.69336,3.7265625 C 42.999538,8.7925926 44,9.4971616 44,10.597656 v -0.0957 C 44,9.5365831 43.450723,8.6551081 42.585938,8.2363281 L 34.347656,4.2480469 C 33.990159,4.0749056 33.607919,3.9937118 33.228516,4 Z"/>
|
||||
<path style="opacity:0.2" d="m 7.7949219,14.013672 c -0.3776621,0.01688 -0.7500093,0.162154 -1.046875,0.433594 l -2.203125,2.013672 c -0.7262313,0.66403 -0.7272183,1.813415 -0.00195,2.478515 L 31.507812,44.265625 c 0.921938,0.92728 2.498047,0.270434 2.498047,-1.041016 V 33.992188 L 8.875,14.351562 C 8.5553748,14.107688 8.1725839,13.996788 7.7949219,14.013672 Z"/>
|
||||
<path style="fill:#008eda" d="m 42.585238,39.76287 -8.236691,3.98885 c -0.953325,0.4616 -2.092785,0.26684 -2.841079,-0.48563 L 4.5434118,17.9383 c -0.7252652,-0.6651 -0.7244313,-1.81357 0.0018,-2.4776 L 6.7477221,13.4468 C 7.3414535,12.90392 8.2356109,12.86395 8.8748613,13.3517 L 41.345838,38.728 c 1.089335,0.83116 2.654005,0.0498 2.654005,-1.32558 v 0.0963 c 0,0.96529 -0.54982,1.8453 -1.414605,2.26418 z"/>
|
||||
<path style="opacity:0.1;fill:#ffffff" d="m 7.7949219,13.013672 c -0.3776621,0.01688 -0.7500093,0.162154 -1.046875,0.433594 l -2.203125,2.013672 c -0.5000274,0.4572 -0.6489097,1.141573 -0.4609375,1.742187 0.084895,-0.274483 0.232597,-0.533404 0.4609375,-0.742187 l 2.203125,-2.013672 C 7.3417783,13.904386 8.2357496,13.863813 8.875,14.351562 l 32.470703,25.376954 c 0.218775,0.166924 0.458624,0.251779 0.699219,0.296875 l 0.541016,-0.261719 C 43.450723,39.344792 44,38.463337 44,37.498047 v -0.0957 c 0,1.37538 -1.564962,2.157332 -2.654297,1.326172 L 8.875,13.351562 C 8.5553748,13.107688 8.1725839,12.996788 7.7949219,13.013672 Z"/>
|
||||
<path style="fill:#1eacf8" d="m 34.349015,43.75235 c -0.953637,0.46128 -2.093097,0.26637 -2.841391,-0.48626 0.921938,0.92728 2.498475,0.27046 2.498475,-1.04099 V 5.7749 c 0,-1.31145 -1.576537,-1.96824 -2.498475,-1.0409 0.748294,-0.75263 1.887754,-0.94767 2.841391,-0.48637 l 8.235286,3.98336 C 43.44971,8.64955 44,9.52989 44,10.49568 v 27.00883 c 0,0.96576 -0.55029,1.84608 -1.415699,2.26464 z"/>
|
||||
<path style="opacity:0.2;fill:#ffffff" d="m 33.228516,4 c -0.632416,0.010668 -1.25302,0.2639813 -1.720704,0.734375 0.733274,-0.7375703 1.869708,-0.4650267 2.308594,0.3339844 0.181092,0.041077 0.360845,0.096313 0.533203,0.1796875 l 8.234375,3.9824219 C 43.449393,9.6490288 44,10.530304 44,11.496094 v -1 C 44,9.5303037 43.449393,8.6490287 42.583984,8.2304688 L 34.349609,4.2480469 C 33.991996,4.0750594 33.607965,3.9935994 33.228516,4 Z m 0.777343,38.224609 c 0,1.31145 -1.576109,1.968296 -2.498047,1.041016 0.613049,0.616601 1.487727,0.852234 2.308594,0.666016 0.112922,-0.205581 0.189453,-0.438658 0.189453,-0.707032 z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
BIN
packs/test_pack/wallpaper.png
Normal file
|
After Width: | Height: | Size: 878 KiB |
45
readme.md
@@ -2,13 +2,15 @@
|
||||
|
||||
[Roadmap](#roadmap) | [Features](#features) | [Use](#use) | [Requests](#requests) | [Contribute](#contribute)
|
||||
|
||||
Color Manager is a program for recoloring existing svg-based icon packs as well as themes. The program is designed for [NovaOS](https://github.com/NicklasVraa/NovaOS) and is currently in **early development**. The first release will be late August 2023. In the meantime, this repository will act as a preview.
|
||||
Color Manager is a program for recoloring and manipulating existing icon packs, wallpapers and themes. The program is designed for [NovaOS](https://github.com/NicklasVraa/NovaOS) and is currently in **early development**. The first release will be late August 2023. In the meantime, this repository will act as a preview.
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
**Note**: If you publish an icon- or theme pack variant that was generated using this program, make sure to credit the original creator and this repository.
|
||||

|
||||
|
||||
**Note**: If you publish anything that was generated using this program, make sure to credit the original creator and this repository.
|
||||
|
||||
|
||||
## Roadmap <a name="roadmap"></a>
|
||||
@@ -16,46 +18,41 @@ Color Manager is a program for recoloring existing svg-based icon packs as well
|
||||
- [x] Grayscale, monochromatic and multichromatic recoloring functions.
|
||||
- [x] Command-line interface.
|
||||
- [x] Graphical user interface based on the GTK framework.
|
||||
- [x] Python pip package.
|
||||
- [x] Support pngs and jpgs.
|
||||
- [ ] Speed up multichrome recoloring for pngs and jpgs.
|
||||
- [ ] Basic framework for manipulating GTK, Cinnamon and Metacity themes.
|
||||
- [ ] Intelligent color inversion function.
|
||||
- [ ] Function for adding basic geometry to the backgrounds of icons.
|
||||
- [ ] Python pip package.
|
||||
- [ ] GNU/Linux binary.
|
||||
|
||||
|
||||
## Features <a name="features"></a>
|
||||
Currently, two types of recoloring operations are supported:
|
||||
| Type | Result | Speed |
|
||||
| ----------- | ------ | ---------------- |
|
||||
| Monochrome | A monochromatic variant, colored by appropriate shades of the provided base color. | ~5000 icons/sec |
|
||||
| Multichrome | A multichromatic variant, where all colors are replaced by their nearest perceived equivalent that adheres to the provided color palette. | ~70 icons/sec |
|
||||
| Type | Result | Speed | Supports |
|
||||
| ----------- | ------ | ---------------- | -------- |
|
||||
| Monochrome | A monochromatic variant, colored by appropriate shades of the provided base color. | ~5000 svgs/sec | svg, png, jpg |
|
||||
| Multichrome | A multichromatic variant, where all colors are replaced by their nearest perceived equivalent that adheres to the provided color palette. | ~70 svgs/sec | svg |
|
||||
|
||||
Speeds were recorded with an Intel i7-4770K CPU. Any svg-based icon pack can serve as the base for any color palette or base color. For the best result when doing monochromatic recoloring, a pack where all icons have the same average saturation and lightness is recommended.
|
||||
Speeds were recorded with an Intel i7-4770K CPU. Any pack can serve as the base for any color palette or base color.
|
||||
|
||||
|
||||
## Using the Program<a name="use"></a>
|
||||
Either import `recolor` into your own script and call the recoloring functions, e.g.:
|
||||
Either import `utils` into your own script and call the recoloring functions, e.g.:
|
||||
```python
|
||||
from color_manager import recolor as rc
|
||||
from color_manager import utils
|
||||
```
|
||||
```python
|
||||
src = "packs/papirus-mini_mono"
|
||||
name = "my_mono_pack"
|
||||
dest = "~/Downloads"
|
||||
hsl = (0.5, 0.5, 0.5) # = rc.normalize_hsl(180, 50, 50)
|
||||
|
||||
rc.monochrome_pack(src, dest, name, hsl)
|
||||
```
|
||||
```python
|
||||
src = "packs/papirus-mini_multi"
|
||||
name = "my_multi_pack"
|
||||
src = "packs/test_pack"
|
||||
name = "my_pack"
|
||||
dest = "~/Downloads"
|
||||
hsl = (0.5, 0.5, 0.5) # = rc.norm_hsl(180, 50, 50)
|
||||
palette = "palettes/dracula.json"
|
||||
|
||||
rc.multichrome_pack(src, dest, name, palette)
|
||||
utils.recolor(src, dest, name, hsl) # hsl or palette.
|
||||
```
|
||||
|
||||
Or launch the GUI by running `python3 color_manager/gui.py` in a terminal from the project's root directory. The GUI will adopt your active theme. Dependencies: `colormath` and `tqdm`. For the GUI, `pygobject` (GTK bindings) must also be installed.
|
||||
Or launch the GUI by running `python3 color_manager/gui.py` in a terminal from the project's root directory. The GUI will adopt your active theme. Dependencies: `colormath`, `tqdm` and `pillow`. For the GUI, `pygobject` (GTK bindings) must also be installed.
|
||||
|
||||
|
||||
## Requests <a name="requests"></a>
|
||||
|
||||
BIN
res/png_jpg_example.png
Normal file
|
After Width: | Height: | Size: 376 KiB |
5
setup.py
@@ -6,7 +6,7 @@ setup(
|
||||
version="0.1.0",
|
||||
author="Nicklas Vraa",
|
||||
author_email="nicklasvraa@proton.me",
|
||||
description="A package for recoloring existing svg-based icon packs and themes",
|
||||
description="A package for recoloring icon and wallpaper packs and desktop themes",
|
||||
url="https://github.com/nicklasvraa/color-manager",
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3",
|
||||
@@ -22,6 +22,7 @@ setup(
|
||||
exclude=["tests", "packs"],
|
||||
install_requires=[
|
||||
"colormath",
|
||||
"tqdm"
|
||||
"tqdm",
|
||||
"pillow"
|
||||
],
|
||||
)
|
||||
|
||||
46
test.ipynb
@@ -16,30 +16,14 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from color_manager import recolor as rc"
|
||||
"from color_manager import utils"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 88,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Processing svgs: 100%|██████████| 6/6 [00:00<00:00, 3403.09 file/s]\n",
|
||||
"Processing imgs: 0%| | 0/7 [00:00<?, ? file/s]"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Processing imgs: 100%|██████████| 7/7 [00:07<00:00, 1.08s/ file]\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"src = \"packs/test_pack\"\n",
|
||||
"name = \"my_pack\"\n",
|
||||
@@ -47,29 +31,7 @@
|
||||
"hsl = (0.5, 0.5, 0.5) # = rc.normalize_hsl(180, 50, 50)\n",
|
||||
"palette = \"palettes/dracula.json\"\n",
|
||||
"\n",
|
||||
"rc.recolor(src, dest, name, hsl) # hsl or palette."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 78,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"<PIL.Image.Image image mode=LA size=300x300 at 0x7F0C604A3880>\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"from PIL import Image\n",
|
||||
"import numpy as np\n",
|
||||
"path = \"packs/test_pack/pngs/firefox.png\"\n",
|
||||
"img = Image.open(path)\n",
|
||||
"img.getpixel((1,1))\n",
|
||||
"print(img)"
|
||||
"utils.recolor(src, dest, name, hsl) # hsl or palette."
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||