# 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 opc.hue import getColorGen
from math import sqrt
from random import random

    def __init__(self, bases, color):
        self.points = [Point(base.x, base.y, base.dx, base.dy)
                       for base in bases]
        self.color = color

    def clock(self, matrix):
        for point in self.points:
            point.clock(matrix)

        p = self.points
        matrix.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, self.color)


class Vectors(object):

    DELTA = 0.41

    def __init__(self, matrix, count):

        pointgen = self.positionGenerator(matrix)
        huegen = getColorGen(step=0.15, hue=random())
        self.vecs = [Vector(next(pointgen), next(huegen))
                     for v in range(count)]

    def positionGenerator(self, matrix):
        x = matrix.width/3
        y = matrix.height/3

        points = [

# 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/bounce.py
from opc.hue import getColorGen
from math import sqrt
from random import random


    def __init__(self, bases, color):
        self.points = [Point(base.x, base.y, base.dx, base.dy)
                       for base in bases]
        self.color = color

    def clock(self, matrix):
        for point in self.points:
            point.clock(matrix)

        p = self.points
        matrix.drawLine(p[0].x, p[0].y, p[1].x, p[1].y, self.color)


class Vectors(object):

    DELTA = 0.41

    def __init__(self, matrix, count):

        pointgen = self.positionGenerator(matrix)
        huegen = getColorGen(step=0.15, hue=random())
        self.vecs = [Vector(next(pointgen), next(huegen))
                     for v in range(count)]

    def positionGenerator(self, matrix):
        x = matrix.width/3
        y = matrix.height/3

        points = [

            Point(x, matrix.midHeight, -self.DELTA, self.DELTA),