GLXCurses.libs.Colors module

class GLXCurses.libs.Colors.Colors[source]

Bases: object

itu_recommendation

Get itu_recommendation property value

Where:

https://en.wikipedia.org/wiki/ITU-R

https://en.wikipedia.org/wiki/Rec._601

https://en.wikipedia.org/wiki/Rec._709

https://en.wikipedia.org/wiki/Rec._2100

Allowed Value: ‘BT.601’, ‘BT.709’, ‘BT.2100’ Default Value: ‘BT.601’

Returns:itu_recommendation property value
Return type:str
color_detection_value
static curses_color(color)[source]

A “translation” function that converts standard-intensity CGA color numbers (0 to 7) to curses color numbers, using the curses constant names like COLOR_BLUE or COLOR_RED

Parameters:color
Returns:curses.COLOR
static curses_color_pair_number(fg, bg)[source]

A function to set an integer bit pattern based on the classic color byte

Parameters:
  • fg (int) – Foreground color
  • bg (int) – Background color
curses_color_pairs_init()[source]

It function create all possible color pairs

Returns:
static strip_hash(str_rgb)[source]

Strip leading # if exists.

Parameters:str_rgb (str) – the str it contain a # or not
Returns:a str without #
Return type:str
get_luma_component_rgb(r, g, b)[source]
static rgb_to_ansi16(r, g, b)[source]
rgb_to_curses_attributes(r, g, b)[source]
rgb_hex_to_list_int(str_rgb)[source]
color(fg=None, bg=None, attributes=None)[source]

Convert a RGB value to a directly usable curses color

draw(y, x, “Hello”, color) where the return of it function is directly usable

Returns:color.pair | curses.Attribut
Return type:int
hex_rgb_to_curses(fg=None, bg=None)[source]

Convert a RGB value to a directly usable curses color

draw(y, x, “Hello”, color) where the return of it function is directly usable

bg=’#000000’, FG=’#FFFFFF’

Returns:color.pair | curses.Attribut
Return type:int