WEBLEB
Startseite
Editor
Anmelden
Pro
Deutsch
English
Français
Español
Português
Deutsch
Italiano
हिंदी
Mo
47
mironovbogdan341
Im Editor öffnen
Veröffentlichen Sie Ihren Code
Empfohlen
17 May 2025
tanzendes Emoji
17 May 2025
moderne soziale
13 January 2025
Ein Code von mo832860
HTML
Copy
CSS
Copy
<!-- Replace with your CSS Code (Leave empty if not needed) -->
JS
Copy
import tkinter as tk # Function to change the background color based on RGB values def change_color(r, g, b): color = f'#{r:02x}{g:02x}{b:02x}' # Convert RGB to hex root.config(bg=color) # Change the background color # Create the main window root = tk.Tk() root.title('RGB Background Color') root.geometry('300x200') root.config(bg='black') # Set initial background to black # Create a button to change the color button = tk.Button(root, text='Change Color', command=lambda: change_color(255, 0, 0)) # Change to red button.pack(pady=20) # Start the GUI event loop root.mainloop()