# Path: opc/hue.py
# def getColorGen(step=0.05, hue=0, sat=1, val=1):
#     """
#     Generator that returns a stream of shades as colors
#     """
#     hue = getHueGen(step, hue)
#     while True:
#         yield hsvToRgb(next(hue), sat, val)


from ._baseclass import ArtBaseClass
from math import sin, cos, sqrt
from opc.colors import BLACK
from opc.hue import getColorGen

        r = self.r - reduction
        x = matrix.midWidth
        y = matrix.midHeight

        poly = [
            (self.irnd(x + r*tc - r*ts), self.irnd(y + r*tc + r*ts)),  # UL
            (self.irnd(x - r*tc - r*ts), self.irnd(y + r*tc - r*ts)),  # UR
            (self.irnd(x - r*tc + r*ts), self.irnd(y - r*tc - r*ts)),  # BR
            (self.irnd(x + r*tc + r*ts), self.irnd(y - r*tc + r*ts)),  # BL
            ]

        return poly

    def start(self, matrix):
        matrix.hq(True)

        # the width of the rectangle should allow for good fit when it is
        # rotated 45 degrees. We can invoke the work of pythagoras to determine
        # the hypotenuse, but rule of thumb (widest point is 1.7 broader than
        # the narrowest
        #
        self.r = min(matrix.midWidth, matrix.midHeight) * 0.7

    def refresh(self, matrix):
        self.theta += 0.05
        color = next(self.hue)

        matrix.clear()
        matrix.fillPoly(self.poly(matrix, 0), color)

# Path: opc/hue.py
# def getColorGen(step=0.05, hue=0, sat=1, val=1):
#     """
#     Generator that returns a stream of shades as colors
#     """
#     hue = getHueGen(step, hue)
#     while True:
#         yield hsvToRgb(next(hue), sat, val)


# Path: art/rsquare.py
from ._baseclass import ArtBaseClass
from math import sin, cos, sqrt
from opc.colors import BLACK
from opc.hue import getColorGen


        r = self.r - reduction
        x = matrix.midWidth
        y = matrix.midHeight

        poly = [
            (self.irnd(x + r*tc - r*ts), self.irnd(y + r*tc + r*ts)),  # UL
            (self.irnd(x - r*tc - r*ts), self.irnd(y + r*tc - r*ts)),  # UR
            (self.irnd(x - r*tc + r*ts), self.irnd(y - r*tc - r*ts)),  # BR
            (self.irnd(x + r*tc + r*ts), self.irnd(y - r*tc + r*ts)),  # BL
            ]

        return poly

    def start(self, matrix):
        matrix.hq(True)

        # the width of the rectangle should allow for good fit when it is
        # rotated 45 degrees. We can invoke the work of pythagoras to determine
        # the hypotenuse, but rule of thumb (widest point is 1.7 broader than
        # the narrowest
        #
        self.r = min(matrix.midWidth, matrix.midHeight) * 0.7

    def refresh(self, matrix):
        self.theta += 0.05
        color = next(self.hue)

        matrix.clear()
        matrix.fillPoly(self.poly(matrix, 0), color)

        matrix.fillPoly(self.poly(matrix, self.width), BLACK)