colorise.win package¶
Submodules¶
colorise.win.cluts module¶
-
colorise.win.cluts.
to_codes
(bg, color, attributes)[source]¶ Convert a set of attributes to Windows character attributes.
-
colorise.win.cluts.
color_from_name
(name, color_count, bg, attributes)[source]¶ Return the color value and color count for a given color name.
colorise.win.color_functions module¶
-
colorise.win.color_functions.
num_colors
()[source]¶ Get the number of colors supported by the terminal.
-
colorise.win.color_functions.
or_bit_flags
(*bit_flags)[source]¶ Bitwise OR together a list of bitflags into a single flag.
colorise.win.win32_functions module¶
Windows API functions.
-
colorise.win.win32_functions.
can_redefine_colors
()[source]¶ Return whether the terminal allows redefinition of colors.
-
colorise.win.win32_functions.
create_std_handle
(handle_id)[source]¶ Create a Windows standard handle from an identifier.
-
colorise.win.win32_functions.
get_win_handle
(target)[source]¶ Return the Windows handle corresponding to a Python handle.
-
colorise.win.win32_functions.
get_windows_clut
()[source]¶ Query and return the internal Windows color look-up table.
-
colorise.win.win32_functions.
enable_virtual_terminal_processing
(handle)[source]¶ Enable Windows processing of ANSI escape sequences.
-
colorise.win.win32_functions.
restore_console_mode
(handle, restore_mode)[source]¶ Restore the console mode for a handle to its original mode.
-
colorise.win.win32_functions.
restore_console_modes
()[source]¶ Restore console modes for stdout and stderr to their original mode.
-
colorise.win.win32_functions.
can_interpret_ansi
()[source]¶ Return True if the Windows console can interpret ANSI escape codes.
-
colorise.win.win32_functions.
set_console_text_attribute
(handle, flags)[source]¶ Set the console’s text attributes.
-
colorise.win.win32_functions.
encode_rgb_tuple
(rgb)[source]¶ Hexadecimally encode an rgb tuple as 0xbbggrr.
-
colorise.win.win32_functions.
redefine_colors
(color_map, file=sys.stdout)[source]¶ Redefine the base console colors with a new mapping.
This only redefines the 8 colors in the console and changes all text in the console that already uses the logical names. E.g. if ‘red’ is mapped to the color red and this function changes it to another color, all text in ‘red’ will be rendered with this new color, even though it may already have been written to the console.
colorise.win.winhandle module¶
Class for Windows handles.
-
class
colorise.win.winhandle.
WinHandle
(handle)[source]¶ Bases:
object
Represents a Windows stream handle.
-
bg
¶ Return the current background color set for the handle.
-
console_mode
¶ Return the current console mode for the handle.
-
default_bg
¶ Return the default background color set for the handle.
-
default_fg
¶ Return the default foreground color set for the handle.
-
fg
¶ Return the current foreground color set for the handle.
-
handle
¶ Return the internal Windows handle.
-