# 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, pi
from opc.hue import getColorGen
from .utils.frange import frange
    def __init__(self, x, y, radius):
        self.x = x
        self.y = y
        self.phase = 0
        self.radius = radius

    def transform(self, angle):
        x = self.x + self.radius * sin(angle)
        y = self.y + self.radius * cos(angle)

        return x, y


class Racer(object):

    def __init__(self, x, y, position, accel):
        self.polar = Polar(x, y, position)
        self.accel = accel

    def next(self, theta):
        angle = self.accel * sin(theta)

        return self.polar.transform(angle)


class Art(ArtBaseClass):

    description = "Racing pixels"

    def __init__(self, matrix, config):

# 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/race.py
from ._baseclass import ArtBaseClass
from math import sin, cos, pi
from opc.hue import getColorGen
from .utils.frange import frange

    def __init__(self, x, y, radius):
        self.x = x
        self.y = y
        self.phase = 0
        self.radius = radius

    def transform(self, angle):
        x = self.x + self.radius * sin(angle)
        y = self.y + self.radius * cos(angle)

        return x, y


class Racer(object):

    def __init__(self, x, y, position, accel):
        self.polar = Polar(x, y, position)
        self.accel = accel

    def next(self, theta):
        angle = self.accel * sin(theta)

        return self.polar.transform(angle)


class Art(ArtBaseClass):

    description = "Racing pixels"

    def __init__(self, matrix, config):

        self.hue = getColorGen(0.001)