# 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
        self.current_color = self.colors[self.color_index]
        self.add_chars()

    def mainloop(self):
        self.root.mainloop()


def test_dict(chars_dict, width, height):
    for char, data in sorted(chars_dict.items()):
        if len(data) != height:
            print(f"Char {char!r} has wrong height / row count !")
            print(f"Should have {height:d} rows, but has: {len(data):d} rows")
        for line in data:
            if len(line) != width:
                print(f"Char {char!r} has wrong width / column count !")
                print(f"Should have {width:d} columns, but has: {len(line):d} columns")


if __name__ == "__main__":
    test_dict(CHARS_DICT, width=8, height=13)

#     scale_factor = 1
#     scale_factor = 2
#     scale_factor = 3
    scale_factor = 4
#     scale_factor = 8
    tk_font = TkImageFont(
        CHARS_DICT, scale_factor,
    )


# 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

        self.current_color = self.colors[self.color_index]
        self.add_chars()

    def mainloop(self):
        self.root.mainloop()


def test_dict(chars_dict, width, height):
    for char, data in sorted(chars_dict.items()):
        if len(data) != height:
            print(f"Char {char!r} has wrong height / row count !")
            print(f"Should have {height:d} rows, but has: {len(data):d} rows")
        for line in data:
            if len(line) != width:
                print(f"Char {char!r} has wrong width / column count !")
                print(f"Should have {width:d} columns, but has: {len(line):d} columns")


if __name__ == "__main__":
    test_dict(CHARS_DICT, width=8, height=13)

#     scale_factor = 1
#     scale_factor = 2
#     scale_factor = 3
    scale_factor = 4
#     scale_factor = 8
    tk_font = TkImageFont(
        CHARS_DICT, scale_factor,
    )


    colors = (NORMAL, INVERTED) + COLORS