Skip to content

Commit

Permalink
Use a color theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Shoes01 committed Apr 14, 2019
1 parent e03ffdc commit ab3bd1b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 25 deletions.
88 changes: 65 additions & 23 deletions _data.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,37 +54,79 @@
)

### COLOR DATA
"""
# FrontEndDelight Theme
COLOR_THEME = {
"Black": (36,36,38),
"Blue": (44,112,183),
"BrightBlack": (94,172,108),
"BrightBlue": (51,147,201),
"BrightCyan": (78,188,229),
"BrightGreen": (116,235,76),
"BrightMagenta": (231,94,78),
"BrightRed": (246,67,25),
"BrightWhite": (139,115,90),
"BrightYellow": (252,194,36),
"Cyan": (59,160,165),
"Green": (86,87,70),
"Magenta": (240,45,78),
"Red": (248,80,26),
"White": (172,172,172),
"Yellow": (249,118,29),
"Background": (27,27,29)
}
"""
# ENCOM Color Theme
COLOR_THEME = {
"Black": (36,36,38),
"Blue": (0,129,255),
"BrightBlack": (84,84,84),
"BrightBlue": (0,0,255),
"BrightCyan": (0,205,205),
"BrightGreen": (0,238,0),
"BrightMagenta": (255,0,255),
"BrightRed": (255,0,0),
"BrightWhite": (255, 255, 255),
"BrightYellow": (255, 255, 0),
"Cyan": (0,139,139),
"Green": (0,139,0),
"Magenta": (188,0,202),
"Red": (159,0,0),
"White": (187,187,187),
"Yellow": (255,207,0),
"Background": (0, 0, 0)
}

ENTITY_COLORS = {
'corpse': libtcod.red,
'floor': libtcod.white,
'floor_explored': libtcod.darkest_grey,
'player': libtcod.pink,
'potion_heal': libtcod.red,
'wall': libtcod.white,
'wall_explored': libtcod.darkest_grey,
'weapon': libtcod.blue,
'zombie': libtcod.green
'corpse': COLOR_THEME['BrightRed'],
'floor': COLOR_THEME['White'],
'floor_explored': COLOR_THEME['BrightBlack'],
'player': COLOR_THEME['BrightMagenta'],
'potion_heal': COLOR_THEME['Red'],
'wall': COLOR_THEME['White'],
'wall_explored': COLOR_THEME['BrightBlack'],
'weapon': COLOR_THEME['Blue'],
'zombie': COLOR_THEME['Green']
}

LOG_COLORS = {
'combat': libtcod.yellow,
'death': libtcod.dark_red,
'error': libtcod.red,
'failure': libtcod.dark_red,
'system_message': libtcod.dark_green,
'success': libtcod.light_blue,
'warning': libtcod.yellow
'combat': COLOR_THEME['Yellow'],
'death': COLOR_THEME['Red'],
'error': COLOR_THEME['BrightRed'],
'failure': COLOR_THEME['Red'],
'system_message': COLOR_THEME['Green'],
'success': COLOR_THEME['Blue'],
'warning': COLOR_THEME['BrightYellow']
}

UI_COLORS = {
'border_main': libtcod.dark_grey,
'border_secondary': libtcod.white,
'bg': libtcod.black,
'fg': libtcod.white,
'text': libtcod.white,
'text_invalid': libtcod.grey,
'text_mainmenu': libtcod.grey
'border_main': COLOR_THEME['BrightWhite'],
'border_secondary': COLOR_THEME['White'],
'bg': COLOR_THEME['Black'],
'fg': COLOR_THEME['BrightWhite'],
'text': COLOR_THEME['BrightWhite'],
'text_invalid': COLOR_THEME['White'],
'text_mainmenu': COLOR_THEME['White']
}

### BORDER DATA
Expand Down
4 changes: 2 additions & 2 deletions processors/render.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import esper
import tcod as libtcod

from _data import DoubleLineBox, UI_COLORS
from _data import DoubleLineBox, UI_COLORS, COLOR_THEME
from components.game.debug import DebugComponent
from components.game.redraw import RedrawComponent
from components.game.state import StateComponent
Expand Down Expand Up @@ -43,7 +43,7 @@ def process(self):
map_obj[0].print(3, 3, _string, UI_COLORS['text_mainmenu'])

if game_state == 'GameOver':
libtcod.console_set_color_control(libtcod.COLCTRL_1, libtcod.red, libtcod.light_red)
libtcod.console_set_color_control(libtcod.COLCTRL_1, COLOR_THEME['BrightRed'], COLOR_THEME['Red'])
map_obj[0].print(3, 3, 'You have %cDIED%c! Press ESC to return to the Main Menu.' % (libtcod.COLCTRL_1, libtcod.COLCTRL_STOP), UI_COLORS['text_mainmenu'], bg_blend=libtcod.BKGND_NONE)

eqp_obj[0].blit(dest=con_obj[0], dest_x=eqp_obj[1], dest_y=eqp_obj[2], width=eqp_obj[3], height=eqp_obj[4])
Expand Down

0 comments on commit ab3bd1b

Please sign in to comment.