From 77cfffee6177fb0421fa0fce15d6a1875bde4816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20W=C3=BChrer?= Date: Sat, 18 May 2024 21:04:34 +0200 Subject: manuals, sum-down, radix --- colorlist | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100755 colorlist (limited to 'colorlist') diff --git a/colorlist b/colorlist deleted file mode 100755 index 49b8442..0000000 --- a/colorlist +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/python3 - -import tkinter -from tkinter.constants import * - -window = tkinter.Tk () -window.wm_title ('X11 Colours') - -canvas = tkinter.Canvas (window) -frame = tkinter.Frame (canvas) -scrollbar = tkinter.Scrollbar (window, command=canvas.yview) -canvas.configure (yscrollcommand=scrollbar.set) - -scrollbar.pack(fill=Y, expand=1, side=RIGHT) -canvas.pack (fill=BOTH, expand=1, side=LEFT) -canvas.create_window ((0,0), window=frame, anchor=NW) -frame.bind ("", lambda e: canvas.configure (scrollregion=canvas.bbox ('all'))) - -with open ("/etc/X11/rgb.txt") as txt: - colours = txt.readlines () - -for r,g,b,name in ((int(l[0]),int(l[1]),int(l[2]),l[3]) for l in (colour.rstrip ().split (maxsplit=3) for colour in colours[1:])): - # Each colour band should be weighted: Half red is not as bright as half green. - tkinter.Label (frame, text=f'{name} ({r+b+g})', bg=f'#{r:02x}{g:02x}{b:02x}',fg='black' if r+g+b > 381 else 'white').pack (fill=X, expand=1) - -window.mainloop () -- cgit v1.2.3