How can I achieve this transparent/translucent effect? #2392
Unanswered
danyaislearning
asked this question in
Q&A
Replies: 1 comment
-
Found a solution, but it's only for windows system. Needs pywinstyles library.
Still would be great to find a cross-platform solution |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to "dim" some widgets during the loading animation.
Overlaying partially transparent images like
this red square with 50% opacity
seems to be applying to a fg_color of a parent (it is blue in this example) instead of passing through an image.
Exampe:
`import customtkinter as ctk
from PIL import Image
root = ctk.CTk()
frame = ctk.CTkFrame(root, fg_color="blue")
frame.pack()
test_image = ctk.CTkImage(Image.open("test.png"), size=(1000, 670))
image1 = ctk.CTkLabel(frame, image=test_image, text="")
image1.pack()
transparent_image = ctk.CTkImage(Image.open("redsquare.png"), size=(200, 200))
image_label = ctk.CTkLabel(frame, image=transparent_image, text="")
image_label.place(relx=0, rely=0)
root.mainloop()`
Another way would be configuring values of all widgets (all text_color, fg_color, etc) and, I guess, making the image "dimmer" with PIL. This will work, but it can't be the right aproach, it feels like there must be a better way.
Beta Was this translation helpful? Give feedback.
All reactions