summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorErik Rose <erik@mozilla.com>2011-11-07 21:20:05 -0800
committerErik Rose <erik@mozilla.com>2011-11-07 21:20:05 -0800
commite42100c7b42ee175b93a1ecc6f4561d80d599b26 (patch)
tree31478dfd3ea2701200766f694267c863a2299108 /README.rst
parentfdfd1dac35f0e3912d1398e37fc9881a412fdea8 (diff)
downloadblessings-e42100c7b42ee175b93a1ecc6f4561d80d599b26.tar.gz
Add attributes for colors, background colors, and bright colors. Closes #2.
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst43
1 files changed, 35 insertions, 8 deletions
diff --git a/README.rst b/README.rst
index 5b0e527..b0d27f0 100644
--- a/README.rst
+++ b/README.rst
@@ -108,6 +108,35 @@ detail, but I elected to keep Blessings easy to integrate and quick to learn.
.. _`terminfo man page`: http://www.manpagez.com/man/5/terminfo/
+Color
+-----
+
+16 colors, both foreground and background, are available as easy-to-remember
+attributes::
+
+ from blessings import Terminal
+
+ term = Terminal()
+ print term.red + term.bg_green + 'Red on green? Ick!' + term.normal
+ print term.bright_red + term.bg_bright_blue + 'This is even worse!' + term.normal
+
+The available colors are...
+
+* ``black``
+* ``red``
+* ``green``
+* ``yellow``
+* ``blue``
+* ``magenta``
+* ``cyan``
+* ``white``
+
+In addition, there is a ``bright`` version of each. If your terminal does not
+support the bright palette, it will usually render them as black.
+
+You can set the background color instead of the foreground by prepending
+``bg_``, as in ``bg_blue`` or ``bg_bright_white``.
+
Parametrized Capabilities
-------------------------
@@ -118,15 +147,10 @@ pass the parameters right in::
from blessings import Terminal
term = Terminal()
- print 'I am ' + term.color(2) + 'green' + term.normal + '!'
+ print term.create_window(1, 1, 20, 20)
-Parametrized capabilities of interest include...
-
-* ``color`` (takes a number 0-15)
-* ``bg_color`` (background color, also takes a number 0-15)
-
-If you need more, you can also reference any string-returning capability listed
-on the `terminfo man page`_ by the name under the "Cap-name" column.
+You can reference any string-returning capability listed on the `terminfo man
+page`_ by the name under the "Cap-name" column.
.. _`terminfo man page`: http://www.manpagez.com/man/5/terminfo/
@@ -186,6 +210,9 @@ Bugs or suggestions? Visit the `issue tracker`_.
Version History
===============
+1.1
+ * Added nicely named attributes for colors.
+
1.0
* Extracted Blessings from nose-progressive, my `progress-bar-having,
traceback-shortcutting, rootin', tootin' testrunner`_. It provided the