Fixed issue #9 found by ItsTerm1n4l

This commit is contained in:
NicklasVraa
2023-08-28 17:50:45 +02:00
parent c7e2032a21
commit 9dc1efc77f
2 changed files with 14 additions and 117 deletions

View File

@@ -163,11 +163,11 @@ class Window(Gtk.Window):
shared.add(gen_area)
def on_custom_palette_set(self, btn, palette_desc):
self.palette = utils.load_palette_file(btn.get_filename())
self.palette = utils.load_json_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 = utils.load_palette_file(palette_picker.choice)
self.palette = utils.load_json_file(palette_picker.choice)
palette_desc.set_text(self.palette["name"] + ": " + self.palette["desc"])
def on_generate(self, btn):

View File

@@ -2,18 +2,9 @@
"cells": [
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The autoreload extension is already loaded. To reload it, use:\n",
" %reload_ext autoreload\n"
]
}
],
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2\n",
@@ -23,93 +14,39 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/nv/.themes/My_theme_2/index.theme\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"svg: 100%|██████████| 84/84 [00:00<00:00, 453.27it/s]\n",
"css: 100%|██████████| 27/27 [00:00<00:00, 88.42it/s]\n",
"png: 100%|██████████| 442/442 [00:07<00:00, 57.67it/s] \n"
]
}
],
"outputs": [],
"source": [
"# Generate theme pack.\n",
"utils.recolor(\n",
" \"/opt/nova/theme/NovaOS-nord/\", # Source\n",
" \"~/.themes\", # Destination\n",
" \"My_theme_2\", # New name\n",
" utils.norm_hsl(22, 25, 48)\n",
" \"NovaOS-woodland\", # New name\n",
" utils.norm_hsl(22, 20, 48)\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/nv/.icons/My_icons/index.theme\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"svg: 100%|██████████| 7974/7974 [00:01<00:00, 5775.11it/s]\n"
]
}
],
"outputs": [],
"source": [
"# Generate icon pack.\n",
"utils.recolor(\n",
" \"/opt/nova/icons/NovaOS-nord\", # Source\n",
" \"~/.icons\", # Destination\n",
" \"My_icons\", # New name\n",
" utils.norm_hsl(118, 26, 55)\n",
" \"NovaOS-woodland\", # New name\n",
" utils.norm_hsl(118, 25, 55)\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/home/nv/.wallpapers/My_wallpapers/index.theme\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"png: 0%| | 0/5 [00:00<?, ?it/s]"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"png: 100%|██████████| 5/5 [00:32<00:00, 6.41s/it]\n"
]
}
],
"outputs": [],
"source": [
"# Generate wallpaper pack.\n",
"utils.recolor(\n",
@@ -119,46 +56,6 @@
" utils.norm_hsl(0, 48, 65)\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'#0000000C'"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"utils.css_to_hex(\"rgba(0, 0, 0, 0.05)\")"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'rgba(0, 0, 0, 0.05)'"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"utils.hex_to_css(\"#0000000C\")"
]
}
],
"metadata": {