tartley / colorama

Simple cross-platform colored terminal text in Python
BSD 3-Clause "New" or "Revised" License
3.51k stars 249 forks source link

Add UNDERLINE and NEGATIVE to ansi.py #354

Closed LqdBcnAtWork closed 1 year ago

LqdBcnAtWork commented 1 year ago

add UNDERLINE, and NEGATIVE support to the AnsiStyle class,

add RGB methods to AnsiBack and AnsiFore classes

tested RGB functions using:

import colorama
from colorama import Fore, Back, Style, Cursor

colorama.just_fix_windows_console()

for r in range(0,256,15):
  for g in range(0,256,15):
    b=0
    print(Fore.RGB(256-r,256-g,255)+Back.RGB(r,g,b)+f"({r:3} {g:3})", end="")
  print()

print(Style.RESET_ALL, end="")

Result on win10: image

LqdBcnAtWork commented 1 year ago

I'm still learning GIT, closing this commit, going to pull request the right one. aka master