File: gradient.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 (26 lines) | stat: -rw-r--r-- 551 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
# Gradient

*Module*: `terminaltexteffects.utils.graphics`

## Basic Usage

```python
from terminaltexteffects.utils.graphics import Gradient, Color

rgb = Gradient(Color("#ff0000"), Color("#00ff00"), Color("#0000ff"), steps=5)
for color in rgb:
    # color is a hex string
    ...
```

## Printing Gradients

Gradients can be printed to the terminal to show information about the stops, steps, and resulting spectrum.

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

---

## Gradient Reference

::: terminaltexteffects.utils.graphics.Gradient