From 6f1cdfdaacabecddcb8546f3e6399354b36a25c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Thu, 31 Mar 2022 16:36:22 +0300 Subject: [PATCH] Improve code for ease of color change --- fetchpy | 60 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/fetchpy b/fetchpy index c1be375..b6660d6 100755 --- a/fetchpy +++ b/fetchpy @@ -4,23 +4,21 @@ # # fetchpy, fetch script alternative to neofetch import os -import sys import subprocess as sp -from termcolor import cprint from rich.console import Console from rich.traceback import install install(show_locals=True) def coloring(text): - red = '#FF0018' - orange = '#FFA52C' - yellow = '#FFFF41' - green = '#008018' - blue = '#0000F9' - frame = 'red' - info = 'yellow' - title = 'yellow' + color1 = '#' + '785BAF' + color2 = '#' + 'DF73AA' + color3 = '#' + 'B6D871' + color4 = '#' + 'F1E7C2' + color5 = '#' + '77B2CC' + frame = color2 + info = color3 + title = color5 color_dictionary = { '╭': frame, '╰': frame, @@ -42,27 +40,27 @@ def coloring(text): 'UPT': info, 'ferit@navi': title, 'Hardware': title, - '-@\n': red, - '.##@': red, - '.####@': red, - '@#####@': orange, - '.**######@': orange, - '.##@o@#####@': orange, - '.############@': yellow, - '.##############@': yellow, - '@######@**%######@': yellow, - '@######`': green, - '%#####o': green, - '@######@': green, - '######%': green, - '-@#######h': green, - '######@.`': green, - '.#####h**``': blue, - '`**%@####@': blue, - '@H@*`': blue, - '*`': blue, - '`*%#@': blue, - '`*': blue, + '-@\n': color1, + '.##@': color1, + '.####@': color1, + '@#####@': color2, + '.**######@': color2, + '.##@o@#####@': color2, + '.############@': color3, + '.##############@': color3, + '@######@**%######@': color3, + '@######`': color4, + '%#####o': color4, + '@######@': color4, + '######%': color4, + '-@#######h': color4, + '######@.`': color4, + '.#####h**``': color5, + '`**%@####@': color5, + '@H@*`': color5, + '*`': color5, + '`*%#@': color5, + '`*': color5, } c = Console() iterator = 0