More colors and structuring color codes
This commit is contained in:
parent
13afd1dfee
commit
2c81b71556
@ -3,25 +3,56 @@ from PIL import Image
|
||||
|
||||
COLORS = {
|
||||
(255, 255, 255): 'white',
|
||||
(0, 0, 255): 'blue',
|
||||
(255, 0, 0): 'red',
|
||||
(0, 255, 0): 'lime',
|
||||
(0, 0, 0): 'black',
|
||||
|
||||
(255, 0, 0): 'light_red',
|
||||
(192, 0, 0): 'red',
|
||||
(128, 0, 0): 'dark_red',
|
||||
|
||||
(80, 25, 40): 'maroon',
|
||||
(25, 5, 5): 'dark_maroon',
|
||||
(115, 40, 60): 'light_maroon',
|
||||
|
||||
(165, 90, 25): 'brown',
|
||||
(210, 150, 95): 'light_brown',
|
||||
(50, 40, 10): 'dark_brown',
|
||||
|
||||
(250, 245, 200): 'sand',
|
||||
(255, 128, 0): 'orange',
|
||||
|
||||
(255, 255, 0): 'yellow',
|
||||
(0, 255, 255): 'cyan',
|
||||
(128, 0, 255): 'purple',
|
||||
(255, 0, 255): 'pink',
|
||||
(0, 128, 0): 'green',
|
||||
(0, 128, 255): 'light_blue',
|
||||
(128, 0, 128): 'dark_purple',
|
||||
(128, 128, 128): 'gray',
|
||||
(255, 0, 128): 'dark_pink',
|
||||
(255, 215, 0): 'light_gold',
|
||||
(185, 135, 10): 'dark_gold',
|
||||
(220, 165, 30): 'gold',
|
||||
|
||||
(0, 255, 0): 'light_lime',
|
||||
(0, 128, 0): 'lime',
|
||||
(128, 255, 0): 'salad',
|
||||
(0, 255, 128): 'mint',
|
||||
(128, 255, 0): 'salad'
|
||||
(0, 128, 0): 'green',
|
||||
|
||||
(0, 255, 255): 'cyan',
|
||||
(0, 128, 255): 'light_blue',
|
||||
(0, 0, 255): 'blue',
|
||||
(0, 65, 90): 'dark_blue',
|
||||
|
||||
(128, 0, 128): 'dark_purple',
|
||||
(128, 0, 255): 'purple',
|
||||
(255, 0, 128): 'dark_pink',
|
||||
(255, 0, 255): 'pink',
|
||||
|
||||
(192, 192, 192): 'light_gray',
|
||||
(128, 128, 128): 'gray',
|
||||
(64, 64, 64): 'dark_gray',
|
||||
(0, 0, 0): 'black'
|
||||
}
|
||||
|
||||
#CONVERT for main.py
|
||||
#from collections import OrderedDict
|
||||
#new_colors = dict((value, key) for key, value in COLORS.items())
|
||||
#print(new_colors)
|
||||
#exit(0)
|
||||
|
||||
|
||||
img = Image.open('image.png')
|
||||
pixels = img.load()
|
||||
|
||||
|
61
main.py
61
main.py
@ -16,25 +16,48 @@ def kbv(dict_, value):
|
||||
class RequestHandler(BaseHTTPRequestHandler):
|
||||
MATRIX_SIZE = (800, 1024)
|
||||
COLORS = {
|
||||
'white': (255, 255, 255),
|
||||
'blue': (0, 0, 255),
|
||||
'red': (255, 0, 0),
|
||||
'lime': (0, 255, 0),
|
||||
'black': (0, 0, 0),
|
||||
'orange': (255, 128, 0),
|
||||
'yellow': (255, 255, 0),
|
||||
'cyan': (0, 255, 255),
|
||||
'purple': (128, 0, 255),
|
||||
'pink': (255, 0, 255),
|
||||
'green': (0, 128, 0),
|
||||
'light_blue': (0, 128, 255),
|
||||
'dark_purple': (128, 0, 128),
|
||||
'gray': (128, 128, 128),
|
||||
'dark_pink': (255, 0, 128),
|
||||
'lime': (0, 128, 0),
|
||||
'mint': (0, 255, 128),
|
||||
'salad': (128, 255, 0)
|
||||
}
|
||||
'white': (255, 255, 255),
|
||||
|
||||
'light_red': (255, 0, 0),
|
||||
'red': (192, 0, 0),
|
||||
'dark_red': (128, 0, 0),
|
||||
|
||||
'maroon': (80, 25, 40),
|
||||
'dark_maroon': (25, 5, 5),
|
||||
'light_maroon': (115, 40, 60),
|
||||
|
||||
'brown': (165, 90, 25),
|
||||
'light_brown': (210, 150, 95),
|
||||
'dark_brown': (50, 40, 10),
|
||||
|
||||
'sand': (250, 245, 200),
|
||||
'orange': (255, 128, 0),
|
||||
'yellow': (255, 255, 0),
|
||||
|
||||
'light_gold': (255, 215, 0),
|
||||
'dark_gold': (185, 135, 10),
|
||||
'gold': (220, 165, 30),
|
||||
|
||||
'light_lime': (0, 255, 0),
|
||||
'lime': (0, 128, 0),
|
||||
'salad': (128, 255, 0),
|
||||
'mint': (0, 255, 128),
|
||||
'green': (0, 128, 0),
|
||||
|
||||
'cyan': (0, 255, 255),
|
||||
'light_blue': (0, 128, 255),
|
||||
'blue': (0, 0, 255),
|
||||
'dark_blue': (0, 65, 90),
|
||||
|
||||
'dark_purple': (128, 0, 128),
|
||||
'purple': (128, 0, 255),
|
||||
'dark_pink': (255, 0, 128),
|
||||
'pink': (255, 0, 255),
|
||||
|
||||
'light_gray': (192, 192, 192),
|
||||
'gray': (128, 128, 128),
|
||||
'dark_gray': (64, 64, 64),
|
||||
'black': (0, 0, 0)}
|
||||
|
||||
def do_GET(self):
|
||||
params = parse_qs(self.path[2:])
|
||||
|
Loading…
Reference in New Issue
Block a user