# 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 random import randint, random
from opc.colors import BLACK
from opc.hue import getColorGen




class Instance(object):

    def __init__(self, matrix, x, color):
        self.color = color
        self.mid = matrix.height/2
        self.x = x
        self.y = 0

    def vote(self, value):
        if self.x == value:
            return True

        if self.y > self.mid:
            return False

        if self.x-1 <= value <= self.x+1:
            return True

        return False

    def next(self, matrix):
        matrix.drawPixel(self.x, self.y, self.color)

        self.y += 1

# 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/rise.py
from ._baseclass import ArtBaseClass
from random import randint, random
from opc.colors import BLACK
from opc.hue import getColorGen





class Instance(object):

    def __init__(self, matrix, x, color):
        self.color = color
        self.mid = matrix.height/2
        self.x = x
        self.y = 0

    def vote(self, value):
        if self.x == value:
            return True

        if self.y > self.mid:
            return False

        if self.x-1 <= value <= self.x+1:
            return True

        return False

    def next(self, matrix):
        matrix.drawPixel(self.x, self.y, self.color)

        self.y += 1

        return self.y < matrix.height