src.modules.backend.result_color

Enumeration of result colors for Wordle feedback.

Classes

ResultColor(value)

Enumeration of possible letter result colors in Wordle.

class src.modules.backend.result_color.ResultColor(value)[source]

Enumeration of possible letter result colors in Wordle.

GREEN = 'G'
YELLOW = 'Y'
BLACK = 'B'
classmethod from_char(char)[source]

Convert a character representation to the corresponding ResultColor.

Return type:

ResultColor

classmethod is_valid_result_string(result)[source]

Check if a string contains only valid result characters.

Return type:

bool

classmethod is_winning_result(result)[source]

Check if a result string represents a winning game (all green).

Return type:

bool

classmethod result_to_emoji(result)[source]

Convert a result string to emoji representation for sharing.

Return type:

str

classmethod parse_result(result_str)[source]

Parse a string of result characters into a list of ResultColor objects.

Return type:

List[ResultColor]

classmethod format_result(colors)[source]

Convert a list of ResultColor objects to a string representation.

Return type:

str

to_style()[source]

Get the Rich style string for this color.

Return type:

str