Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added windows 10 support and cleaned up some formatting. #4

Open
wants to merge 9 commits into
base: <3
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions gay.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
from unicodedata import east_asian_width
if platform == 'win32':
from signal import signal, SIG_DFL
from ctypes import windll
from ctypes import *
WindowsColorTerm = True
# k=windll.kernel32
# k.SetConsoleMode(k.GetStdHandle(-11),7)
# maybe not needed??
k=windll.kernel32
k.SetConsoleMode(k.GetStdHandle(-11),7)
else:
from signal import signal, SIGPIPE, SIG_DFL

Expand Down Expand Up @@ -251,7 +250,7 @@ def decor_24(rgb: RGB) -> Iterator[str]:

def decor_for(space: ColourSpace) -> Tuple[str, str, Callable[[RGB], Iterator[str]]]:
if space == ColourSpace.EIGHT or WindowsColorTerm == True:
return "\x1b[38;5;", "\x1b[48;5;", decor_8
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 characters, seriously. that's all this changes.

return "\x1b[38;5;m", "\x1b[48;5;m", decor_8
elif space == ColourSpace.TRUE:
return "\x1b[38;2;", "\x1b[48;2;", decor_24
else:
Expand Down