improved code and folder structure
This commit is contained in:
parent
3b4e29345f
commit
b83405d918
|
@ -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
|
import customtkinter as Ctk
|
||||||
from PIL import Image, ImageTk
|
from PIL import Image, ImageTk
|
||||||
import os
|
import os
|
||||||
import math
|
import math
|
||||||
|
|
||||||
PATH = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
|
|
||||||
class AskColor(Ctk.CTkToplevel):
|
class AskColor(Ctk.CTkToplevel):
|
||||||
|
|
||||||
|
@ -52,9 +57,8 @@ class AskColor(Ctk.CTkToplevel):
|
||||||
|
|
||||||
self.canvas.bind("<B1-Motion>", self.on_mouse_drag)
|
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.img1 = Image.open('icons/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.img2 = Image.open('icons/target.png').resize((self.target_dimension, self.target_dimension), Image.Resampling.LANCZOS)
|
||||||
|
|
||||||
self.wheel = ImageTk.PhotoImage(self.img1)
|
self.wheel = ImageTk.PhotoImage(self.img1)
|
||||||
self.target = ImageTk.PhotoImage(self.img2)
|
self.target = ImageTk.PhotoImage(self.img2)
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 933 B |
Loading…
Reference in New Issue