Cleaned up wv_colors.py
*Reformatted with autopep8 *renamed input->inp to avoid shadowing input() function
This commit is contained in:
parent
854f06dd79
commit
9cb3608b27
@ -1,8 +1,11 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
COLOR_CODES = {
|
COLOR_CODES = {
|
||||||
'DIN': ['WH','BN','GN','YE','GY','PK','BU','RD','BK','VT'], # ,'GYPK','RDBU','WHGN','BNGN','WHYE','YEBN','WHGY','GYBN','WHPK','PKBN'],
|
# ,'GYPK','RDBU','WHGN','BNGN','WHYE','YEBN','WHGY','GYBN','WHPK','PKBN'],
|
||||||
'IEC': ['BN','RD','OG','YE','GN','BU','VT','GY','WH','BK'],
|
'DIN': ['WH', 'BN', 'GN', 'YE', 'GY', 'PK', 'BU', 'RD', 'BK', 'VT'],
|
||||||
'BW': ['BK','WH']
|
'IEC': ['BN', 'RD', 'OG', 'YE', 'GN', 'BU', 'VT', 'GY', 'WH', 'BK'],
|
||||||
}
|
'BW': ['BK', 'WH'],
|
||||||
|
}
|
||||||
|
|
||||||
color_hex = {
|
color_hex = {
|
||||||
'BK': '#000000',
|
'BK': '#000000',
|
||||||
@ -17,7 +20,7 @@ color_hex = {
|
|||||||
'BU': '#0066ff',
|
'BU': '#0066ff',
|
||||||
'VT': '#8000ff',
|
'VT': '#8000ff',
|
||||||
'BN': '#666600',
|
'BN': '#666600',
|
||||||
}
|
}
|
||||||
|
|
||||||
color_full = {
|
color_full = {
|
||||||
'BK': 'black',
|
'BK': 'black',
|
||||||
@ -49,26 +52,27 @@ color_ger = {
|
|||||||
'BN': 'br',
|
'BN': 'br',
|
||||||
}
|
}
|
||||||
|
|
||||||
def translate_color(input, color_mode):
|
|
||||||
if input == '':
|
def translate_color(inp, color_mode):
|
||||||
|
if inp == '':
|
||||||
output = ''
|
output = ''
|
||||||
else:
|
else:
|
||||||
if color_mode == 'full':
|
if color_mode == 'full':
|
||||||
output = color_full[input].lower()
|
output = color_full[inp].lower()
|
||||||
elif color_mode == 'FULL':
|
elif color_mode == 'FULL':
|
||||||
output = color_full[input].upper()
|
output = color_full[inp].upper()
|
||||||
elif color_mode == 'hex':
|
elif color_mode == 'hex':
|
||||||
output = color_hex[input].lower()
|
output = color_hex[inp].lower()
|
||||||
elif color_mode == 'HEX':
|
elif color_mode == 'HEX':
|
||||||
output = color_hex[input].upper()
|
output = color_hex[inp].upper()
|
||||||
elif color_mode == 'ger':
|
elif color_mode == 'ger':
|
||||||
output = color_ger[input].lower()
|
output = color_ger[inp].lower()
|
||||||
elif color_mode == 'GER':
|
elif color_mode == 'GER':
|
||||||
output = color_ger[input].upper()
|
output = color_ger[inp].upper()
|
||||||
elif color_mode == 'short':
|
elif color_mode == 'short':
|
||||||
output = input.lower()
|
output = inp.lower()
|
||||||
elif color_mode == 'SHORT':
|
elif color_mode == 'SHORT':
|
||||||
output = input.upper()
|
output = inp.upper()
|
||||||
else:
|
else:
|
||||||
raise Exception('Unknown color mode')
|
raise Exception('Unknown color mode')
|
||||||
return output
|
return output
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user