summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blessings/__init__.py2
-rw-r--r--blessings/tests.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/blessings/__init__.py b/blessings/__init__.py
index 1fde89f..c34ab81 100644
--- a/blessings/__init__.py
+++ b/blessings/__init__.py
@@ -205,7 +205,7 @@ class Terminal(object):
the color and set the formatting to normal afterward.
"""
- return self._resolve_numeric_color(num, self._background_color8)
+ return self._resolve_numeric_color(num, self._background_color)
def _resolve_formatter(self, attr):
"""Resolve a sugary or plain capability name, color, or compound formatting function name into a callable capability."""
diff --git a/blessings/tests.py b/blessings/tests.py
index 83b2ee7..beca0f8 100644
--- a/blessings/tests.py
+++ b/blessings/tests.py
@@ -137,8 +137,10 @@ def test_mnemonic_colors():
def test_callable_numeric_colors():
"""``color(n)`` should return a formatting wrapper."""
t = TestTerminal()
+ eq_(t.color(5)('smoo'), t.magenta + 'smoo' + t.normal)
eq_(t.color(5)('smoo'), t.color(5) + 'smoo' + t.normal)
- eq_(t.on_color(6)('smoo'), t.on_color(6) + 'smoo' + t.normal)
+ eq_(t.on_color(2)('smoo'), t.on_green + 'smoo' + t.normal)
+ eq_(t.on_color(2)('smoo'), t.on_color(2) + 'smoo' + t.normal)
def test_null_callable_numeric_colors():