From f1ef31b4a2fafc3137bd6c49efb218ea5064c823 Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Mon, 24 Jan 2022 22:03:34 -0500 Subject: [PATCH] Add files via upload --- engine-q/coloring/gradient.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 engine-q/coloring/gradient.py diff --git a/engine-q/coloring/gradient.py b/engine-q/coloring/gradient.py new file mode 100644 index 0000000..9a20148 --- /dev/null +++ b/engine-q/coloring/gradient.py @@ -0,0 +1,23 @@ +# this script will print a blue gradient on the screen + +# First: +# pip install ansicolors + +from colors import * + +height = 40 +width = 160 +stamp = "py" + +for line in range(0, height): + row_data = "" + + for col in range(0, width): + fgcolor = 2 + 2 * col + if fgcolor > 200 and fgcolor < 210: + row_data = row_data + color(stamp, bg='rgb(0, 0, %d)' % fgcolor) + else: + fg = fgcolor % 256 + row_data = row_data + color(' ', bg='rgb(0, 0, %d)' % fg) + + print(row_data)