# Path: opc/hue.py
# @mwt(timeout=20)
# @timefunc
# def hsvToRgb(h, s=1.0, v=1.0, rainbow=True):
#     """
#     Convert a (h, s, v) value to the (r, g, b) color space. By default,
#     we use a more cpu-intense method to curve the hue ramps above the
#     typical linear, with a view to evening out the visible range of yellow,
#     cyan, and purple.
# 
#     This method takes h, s, and v values in range 0..1 and returns r, g,
#     and b values in range 0..255.
#     """
#     if rainbow:
#         return [sin(c*pi/2)*255 for c in colorsys.hsv_to_rgb(h, s, v)]
# 
#     return [c*255 for c in colorsys.hsv_to_rgb(h, s, v)]
# 
# Path: opc/matrix/hq.py
# class HQ(object):
# 
#     """
#     use the HQ class to savely wrap art init blocks when you need to
#     switch on HQ for set-up purposes. For example:
# 
#         from opc.matrix import HQ
# 
# 
#         class Art(object):
# 
#             def __init__(self, matrix):
# 
#                 with HQ(matrix):
#                     initialization stuff...
#     """
# 
#     def __init__(self, matrix):
#         self.matrix = matrix
# 
#     def __enter__(self):
#         self.matrix.hq()
# 
#     def __exit__(self, type, value, traceback):
#         self.matrix.hq(False)


from ._baseclass import ArtBaseClass
from opc.hue import hsvToRgb
from opc.matrix import HQ
from .utils.fractools import Mandelbrot, Region
from copy import copy



ZOOMSTEPS = 24
ITERSTEPS = 30
DEBUG = False


class Art(ArtBaseClass):

    description = "Auto-zooming mandelbrot"


# Path: opc/hue.py
# @mwt(timeout=20)
# @timefunc
# def hsvToRgb(h, s=1.0, v=1.0, rainbow=True):
#     """
#     Convert a (h, s, v) value to the (r, g, b) color space. By default,
#     we use a more cpu-intense method to curve the hue ramps above the
#     typical linear, with a view to evening out the visible range of yellow,
#     cyan, and purple.
# 
#     This method takes h, s, and v values in range 0..1 and returns r, g,
#     and b values in range 0..255.
#     """
#     if rainbow:
#         return [sin(c*pi/2)*255 for c in colorsys.hsv_to_rgb(h, s, v)]
# 
#     return [c*255 for c in colorsys.hsv_to_rgb(h, s, v)]
# 
# Path: opc/matrix/hq.py
# class HQ(object):
# 
#     """
#     use the HQ class to savely wrap art init blocks when you need to
#     switch on HQ for set-up purposes. For example:
# 
#         from opc.matrix import HQ
# 
# 
#         class Art(object):
# 
#             def __init__(self, matrix):
# 
#                 with HQ(matrix):
#                     initialization stuff...
#     """
# 
#     def __init__(self, matrix):
#         self.matrix = matrix
# 
#     def __enter__(self):
#         self.matrix.hq()
# 
#     def __exit__(self, type, value, traceback):
#         self.matrix.hq(False)


# Path: art/mandel.py
from ._baseclass import ArtBaseClass
from opc.hue import hsvToRgb
from opc.matrix import HQ
from .utils.fractools import Mandelbrot, Region
from copy import copy




ZOOMSTEPS = 24
ITERSTEPS = 30
DEBUG = False


class Art(ArtBaseClass):

    description = "Auto-zooming mandelbrot"


    def __init__(self, matrix, config):