improved code and folder structure

This commit is contained in:
Falko Victor Habel 2024-04-03 18:03:47 +02:00
parent 3b4e29345f
commit b83405d918
3 changed files with 274 additions and 270 deletions

View File

@ -1,11 +1,16 @@
# this is a modified version of the CTkColorPicker from GitHub
"""Fabelous CTK Color Picker for customtkinter
----------------------------------------
Based on the original work by Akash Bora (Akascape)
Contributions from Victor Vimbert-Guerlais (helloHackYnow)
Original: https://github.com/Akascape/CTkColorPicker/tree/main
"""
import customtkinter as Ctk
from PIL import Image, ImageTk
import os
import math
PATH = os.path.dirname(os.path.realpath(__file__))
class AskColor(Ctk.CTkToplevel):
@ -52,9 +57,8 @@ class AskColor(Ctk.CTkToplevel):
self.canvas.bind("<B1-Motion>", self.on_mouse_drag)
self.img1 = Image.open(os.path.join(PATH, 'color_wheel.png')).resize((self.image_dimension, self.image_dimension), Image.Resampling.LANCZOS)
self.img2 = Image.open(os.path.join(PATH, 'target.png')).resize((self.target_dimension, self.target_dimension), Image.Resampling.LANCZOS)
self.img1 = Image.open('icons/color_wheel.png').resize((self.image_dimension, self.image_dimension), Image.Resampling.LANCZOS)
self.img2 = Image.open('icons/target.png').resize((self.target_dimension, self.target_dimension), Image.Resampling.LANCZOS)
self.wheel = ImageTk.PhotoImage(self.img1)
self.target = ImageTk.PhotoImage(self.img2)

View File

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 109 KiB

View File

Before

Width:  |  Height:  |  Size: 933 B

After

Width:  |  Height:  |  Size: 933 B