File: colorpair.md

package info (click to toggle)
terminaltexteffects 0.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,324 kB
  • sloc: python: 16,857; makefile: 3
file content (39 lines) | stat: -rw-r--r-- 792 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ColorPair

*Module*: `terminaltexteffects.utils.graphics`

## Basic Usage

ColorPair objects are used to represent a foreground and background color pair.

### Usage

```python
import terminaltexteffects as tte

color_pair = tte.ColorPair(fg=tte.Color("#FF0000"), bg=tte.Color("#00FF00"))
```

### Alternate Signature

Colors can be specified using strings or integers. Color objects will be created automatically.

```python
import terminaltexteffects as tte

color_pair = tte.ColorPair("#FF0000", "#00FF00")
```

`fg` and/or `bg` are optional and default to `None`.

### Printing ColorPairs

ColorPair objects can be printed to see the resulting colors.

![t](../../img/lib_demos/colorpair_print_example.png)

---

## ColorPair Reference

::: terminaltexteffects.utils.graphics.ColorPair