Skip to content

Commit

Permalink
Fixing colours on OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
snare committed Oct 16, 2013
1 parent e7ed57c commit 001768d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
16 changes: 8 additions & 8 deletions calculon/config/default.cfg
Expand Up @@ -24,35 +24,35 @@
},
"binlabel": {
"attrs": ["bold"],
"colours": ["red", "black"]
"colours": ["red", "none"]
},
"vallabel": {
"attrs": ["bold"],
"colours": ["red", "black"]
"colours": ["red", "none"]
},
"bval": {
"attrs": [],
"colours": ["green", "black"]
"colours": ["green", "none"]
},
"hval": {
"attrs": [],
"colours": ["white", "black"]
"colours": ["white", "none"]
},
"dval": {
"attrs": [],
"colours": ["magenta", "black"]
"colours": ["magenta", "none"]
},
"oval": {
"attrs": [],
"colours": ["magenta", "black"]
"colours": ["magenta", "none"]
},
"aval": {
"attrs": [],
"colours": ["cyan", "black"]
"colours": ["cyan", "none"]
},
"uval": {
"attrs": [],
"colours": ["cyan", "black"]
"colours": ["cyan", "none"]
},
"err": {
"attrs": ["bold"],
Expand Down
16 changes: 8 additions & 8 deletions calculon/config/example.cfg
Expand Up @@ -50,35 +50,35 @@
},
"binlabel": {
"attrs": ["bold"],
"colours": ["red", "black"]
"colours": ["red", "none"]
},
"vallabel": {
"attrs": ["bold"],
"colours": ["red", "black"]
"colours": ["red", "none"]
},
"bval": {
"attrs": [],
"colours": ["green", "black"]
"colours": ["green", "none"]
},
"hval": {
"attrs": [],
"colours": ["white", "black"]
"colours": ["white", "none"]
},
"dval": {
"attrs": [],
"colours": ["magenta", "black"]
"colours": ["magenta", "none"]
},
"oval": {
"attrs": [],
"colours": ["magenta", "black"]
"colours": ["magenta", "none"]
},
"aval": {
"attrs": [],
"colours": ["cyan", "black"]
"colours": ["cyan", "none"]
},
"uval": {
"attrs": [],
"colours": ["cyan", "black"]
"colours": ["cyan", "none"]
},
"err": {
"attrs": ["bold"],
Expand Down
5 changes: 3 additions & 2 deletions calculon/display.py
Expand Up @@ -36,7 +36,8 @@
"magenta" : curses.COLOR_MAGENTA,
"red" : curses.COLOR_RED,
"white" : curses.COLOR_WHITE,
"yellow" : curses.COLOR_YELLOW
"yellow" : curses.COLOR_YELLOW,
"none" : -1
}

VALID_FORMATS = ['h','d','o','a','u','b']
Expand Down Expand Up @@ -71,7 +72,7 @@ def init_config(self, config):
# update curses text attributes
colour_pairs = {}
# Fixme - pull this from curses module (max number of colour pairs)
last_colour_pair = curses.COLOR_PAIRS
last_colour_pair = min(curses.COLOR_PAIRS, 64)
for sec in config['attrs']:
attrs = 0
for attr in config['attrs'][sec]['attrs']:
Expand Down

0 comments on commit 001768d

Please sign in to comment.