# Path: opc/hue.py
# def getHueGen(step=0.05, hue=0):
#     """
#     Generator that returns a stream of shades as hues
#     """
#     while True:
#         hue = fmod(hue + step, 1)
#         yield hue
# 
# @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)]


from ._baseclass import ArtBaseClass
from opc.hue import getHueGen, hsvToRgb
from math import sqrt



GRIDSIZE = 8

C_BACKGROUND = (96, 64, 24)
C_BORDER = (128, 128, 128)


class Art(ArtBaseClass):

    description = "A silly chess board"

    def __init__(self, matrix, config):

# Path: opc/hue.py
# def getHueGen(step=0.05, hue=0):
#     """
#     Generator that returns a stream of shades as hues
#     """
#     while True:
#         hue = fmod(hue + step, 1)
#         yield hue
# 
# @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: art/RETIRED/chess.py
from ._baseclass import ArtBaseClass
from opc.hue import getHueGen, hsvToRgb
from math import sqrt




GRIDSIZE = 8

C_BACKGROUND = (96, 64, 24)
C_BORDER = (128, 128, 128)


class Art(ArtBaseClass):

    description = "A silly chess board"

    def __init__(self, matrix, config):

        self.hue = getHueGen(0.0005)