Commits

sirgazil committed e806692 Draft

Updated section on foreground and background colors

  • Participants
  • Parent commits 32192e4

Comments (0)

Files changed (1)

File docs/source/usage.rst

 
 
 Foreground and background colors
--------------------------------
+--------------------------------
+
+In the code example above, we just specified the foreground color for the
+text. You can use the same method (``Display.color()``) to add a background
+color. The following code will print a white text on a yellow background:
+
+.. sourcecode:: python
+
+   #! /usr/bin/env python
+
+   from colorin.cli import Display
+
+
+   screen = Display()
+   screen.color("Warning!", "White", "Yellow")
 
 The set of colors available for both, text foreground and background, is
 limited to the following list: Black, Red, Green, Yellow, Blue, Magenta,