# Path: dragonpy/Dragon32/dragon_charmap.py
# COLORS = (GREEN, YELLOW, BLUE, RED, WHITE, CYAN, MAGENTA, ORANGE)
# 
# INVERTED = "INVERTED"
# 
# NORMAL = "NORMAL"
# 
# def get_hex_color(color):
#     """
#     >>> get_hex_color(BLUE) == ('000000', '2110b5')
#     True
# 
#     >>> get_hex_color(NORMAL) == ('004100', '00ff00')
#     True
#     """
#     foreground, background = get_rgb_color(color)
#     return (
#         "%02x%02x%02x" % foreground,
#         "%02x%02x%02x" % background,
#     )


import logging
import math
import tkinter
from dragonpy.Dragon32.dragon_charmap import COLORS, INVERTED, NORMAL, get_hex_color
    """

    def __init__(self, chars_dict, scale_factor):
        assert isinstance(scale_factor, int)
        assert scale_factor > 0

        self.chars_dict = chars_dict
        self.scale_factor = scale_factor

        temp = chars_dict["X"]
        self.width_real = len(temp[0])
        self.height_real = len(temp)

        self.width_scaled = self.width_real * self.scale_factor
        self.height_scaled = self.height_real * self.scale_factor

        log.critical("Every character is %ipx x %ipx (incl. scale factor: %i)",
                     self.width_scaled, self.height_scaled,
                     self.scale_factor
                     )

    def get_char(self, char, color):
        log.critical("Generate char %s %s", repr(char), color)
        try:
            char_data = self.chars_dict[char]
        except KeyError:
            log.log(99, "Error: character %s is not in CHARS_DICT !", repr(char))
#             return self._generate_char(char="?", color=color)
            return self.get_char(char="?", color=color)


# Path: dragonpy/Dragon32/dragon_charmap.py
# COLORS = (GREEN, YELLOW, BLUE, RED, WHITE, CYAN, MAGENTA, ORANGE)
# 
# INVERTED = "INVERTED"
# 
# NORMAL = "NORMAL"
# 
# def get_hex_color(color):
#     """
#     >>> get_hex_color(BLUE) == ('000000', '2110b5')
#     True
# 
#     >>> get_hex_color(NORMAL) == ('004100', '00ff00')
#     True
#     """
#     foreground, background = get_rgb_color(color)
#     return (
#         "%02x%02x%02x" % foreground,
#         "%02x%02x%02x" % background,
#     )


# Path: dragonpy/Dragon32/dragon_font.py
import logging
import math
import tkinter
from dragonpy.Dragon32.dragon_charmap import COLORS, INVERTED, NORMAL, get_hex_color

    """

    def __init__(self, chars_dict, scale_factor):
        assert isinstance(scale_factor, int)
        assert scale_factor > 0

        self.chars_dict = chars_dict
        self.scale_factor = scale_factor

        temp = chars_dict["X"]
        self.width_real = len(temp[0])
        self.height_real = len(temp)

        self.width_scaled = self.width_real * self.scale_factor
        self.height_scaled = self.height_real * self.scale_factor

        log.critical("Every character is %ipx x %ipx (incl. scale factor: %i)",
                     self.width_scaled, self.height_scaled,
                     self.scale_factor
                     )

    def get_char(self, char, color):
        log.critical("Generate char %s %s", repr(char), color)
        try:
            char_data = self.chars_dict[char]
        except KeyError:
            log.log(99, "Error: character %s is not in CHARS_DICT !", repr(char))
#             return self._generate_char(char="?", color=color)
            return self.get_char(char="?", color=color)


        foreground, background = get_hex_color(color)