class documentation
class _CharacterAttributes(_textattributes.CharacterAttributesMixin): (source)
Factory for character attributes, including foreground and background color and non-color attributes such as bold, reverse video and underline.
Character attributes are applied to actual text by using object indexing-syntax (obj['abc']) after accessing a factory attribute, for example:
attributes.bold['Some text']
These can be nested to mix attributes:
attributes.bold[attributes.underline['Some text']]
And multiple values can be passed:
attributes.normal[attributes.bold['Some'], ' text']
Non-color attributes can be accessed by attribute name, available attributes are:
- bold
- reverseVideo
- underline
Available colors are:
- white
- black
- blue
- green
- light red
- red
- magenta
- orange
- yellow
- light green
- cyan
- light cyan
- light blue
- light magenta
- gray
- light gray
Present Since | |
13.1 |
Class Variable | attrs |
Undocumented |
Instance Variable | bg |
Background colors accessed by attribute name, see above for possible names. |
Instance Variable | fg |
Foreground colors accessed by attribute name, see above for possible names. |
Inherited from CharacterAttributesMixin
:
Method | __getattr__ |
Undocumented |