# Path: fabulous/text.py
# class Text(image.Image):
# class FontNotFound(ValueError):
#     def __init__(self, text, fsize=23, color="#0099ff", shadow=False,
#                  skew=None, font='NotoSans-Bold'):
# def resolve_font(name):
# def get_font_files():
# def main():
# 
# Path: fabulous/utils.py
# def memoize(function):
#     def _memoize(*args):
#     def __init__(self, bgcolor='black'):
#     def termfd(self):
#     def dimensions(self):
#     def width(self):
#     def height(self):
#     def _get_bgcolor(self):
#     def _set_bgcolor(self, color):
# def pil_check():
# class TerminalInfo(object):
# 
# Path: fabulous/image.py
# class Image(object):
#     def __init__(self, path, width=None):
#     def __iter__(self):
#     def __str__(self):
#     def size(self):
#     def resize(self, width=None):
#     def reduce(self, colors):
#     def convert(self):
# def main():
# 
# Path: fabulous/debug.py
# class DebugImage(image.Image):
#     def reduce(self, colors):
# def main():
# 
# Path: fabulous/xterm256.py
# CUBE_STEPS = [0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF]
# BASIC16 = ((0, 0, 0), (205, 0, 0), (0, 205, 0), (205, 205, 0),
#            (0, 0, 238), (205, 0, 205), (0, 205, 205), (229, 229, 229),
#            (127, 127, 127), (255, 0, 0), (0, 255, 0), (255, 255, 0),
#            (92, 92, 255), (255, 0, 255), (0, 255, 255), (255, 255, 255))
# COLOR_TABLE = [xterm_to_rgb(i) for i in range(256)]
# def xterm_to_rgb(xcolor):
# def rgb_to_xterm(r, g, b):
# def compile_speedup():
#     def xterm_to_rgb(xcolor):
# 
# Path: fabulous/compatibility.py
# def printy(s):
#     """Python 2/3 compatible print-like function"""
#     if hasattr(s, 'as_utf8'):
#         if hasattr(sys.stdout, 'buffer'):
#             sys.stdout.buffer.write(s.as_utf8)
#             sys.stdout.buffer.write(b"\n")
#         else:
#             sys.stdout.write(s.as_utf8)
#             sys.stdout.write(b"\n")
#     else:
#         print(s)


import os
import fabulous
        import urllib
from fabulous import text, utils, image, debug, xterm256
from fabulous.color import *
from fabulous.compatibility import printy
        for z in range(6):
            for x in range(6):
                line += bg256(cube_color(x, y, z), '  ')
            line += " "
        printy(line)

    wait()


def full_chart():
    # grayscales
    line = " "
    for xc in range(232, 256):
        line += bg256(xc, '  ')
    printy(line)
    line = " "
    for xc in range(232, 256)[::-1]:
        line += bg256(xc, '  ')
    printy(line)
    printy('')

    # cube
    printy("")
    cube_color = lambda x,y,z: 16 + x + y*6 + z*6*6
    for y in range(6):
        line = " "
        for z in range(6):
            for x in range(6):
                line += bg256(cube_color(x, y, z), '  ')
            line += " "

# Path: fabulous/text.py
# class Text(image.Image):
# class FontNotFound(ValueError):
#     def __init__(self, text, fsize=23, color="#0099ff", shadow=False,
#                  skew=None, font='NotoSans-Bold'):
# def resolve_font(name):
# def get_font_files():
# def main():
# 
# Path: fabulous/utils.py
# def memoize(function):
#     def _memoize(*args):
#     def __init__(self, bgcolor='black'):
#     def termfd(self):
#     def dimensions(self):
#     def width(self):
#     def height(self):
#     def _get_bgcolor(self):
#     def _set_bgcolor(self, color):
# def pil_check():
# class TerminalInfo(object):
# 
# Path: fabulous/image.py
# class Image(object):
#     def __init__(self, path, width=None):
#     def __iter__(self):
#     def __str__(self):
#     def size(self):
#     def resize(self, width=None):
#     def reduce(self, colors):
#     def convert(self):
# def main():
# 
# Path: fabulous/debug.py
# class DebugImage(image.Image):
#     def reduce(self, colors):
# def main():
# 
# Path: fabulous/xterm256.py
# CUBE_STEPS = [0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF]
# BASIC16 = ((0, 0, 0), (205, 0, 0), (0, 205, 0), (205, 205, 0),
#            (0, 0, 238), (205, 0, 205), (0, 205, 205), (229, 229, 229),
#            (127, 127, 127), (255, 0, 0), (0, 255, 0), (255, 255, 0),
#            (92, 92, 255), (255, 0, 255), (0, 255, 255), (255, 255, 255))
# COLOR_TABLE = [xterm_to_rgb(i) for i in range(256)]
# def xterm_to_rgb(xcolor):
# def rgb_to_xterm(r, g, b):
# def compile_speedup():
#     def xterm_to_rgb(xcolor):
# 
# Path: fabulous/compatibility.py
# def printy(s):
#     """Python 2/3 compatible print-like function"""
#     if hasattr(s, 'as_utf8'):
#         if hasattr(sys.stdout, 'buffer'):
#             sys.stdout.buffer.write(s.as_utf8)
#             sys.stdout.buffer.write(b"\n")
#         else:
#             sys.stdout.write(s.as_utf8)
#             sys.stdout.write(b"\n")
#     else:
#         print(s)


# Path: fabulous/demo.py
import os
import fabulous
        import urllib
from fabulous import text, utils, image, debug, xterm256
from fabulous.color import *
from fabulous.compatibility import printy

        for z in range(6):
            for x in range(6):
                line += bg256(cube_color(x, y, z), '  ')
            line += " "
        printy(line)

    wait()


def full_chart():
    # grayscales
    line = " "
    for xc in range(232, 256):
        line += bg256(xc, '  ')
    printy(line)
    line = " "
    for xc in range(232, 256)[::-1]:
        line += bg256(xc, '  ')
    printy(line)
    printy('')

    # cube
    printy("")
    cube_color = lambda x,y,z: 16 + x + y*6 + z*6*6
    for y in range(6):
        line = " "
        for z in range(6):
            for x in range(6):
                line += bg256(cube_color(x, y, z), '  ')
            line += " "

        printy(line)