# 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


from .. _baseclass import ArtBaseClass
from opc.hue import getHueGen



SEGMENTS=4
HUEDELTA=1/(SEGMENTS*1.5)


class Barber(ArtBaseClass):

    def __init__(self, matrix, config):
        self.width = int(matrix.width/SEGMENTS)
        self.hue = getHueGen(step=0.01)

    def start(self, matrix):
        pass

    def _line(self, matrix, x1, x2, hue):
        raise NotImplementedError

    def refresh(self, matrix):
        matrix.scroll("up")
        matrix.scroll("right")

        hue = next(self.hue)
        for segment in range(SEGMENTS):

# 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


# Path: art/baseclasses/barber.py
from .. _baseclass import ArtBaseClass
from opc.hue import getHueGen




SEGMENTS=4
HUEDELTA=1/(SEGMENTS*1.5)


class Barber(ArtBaseClass):

    def __init__(self, matrix, config):
        self.width = int(matrix.width/SEGMENTS)
        self.hue = getHueGen(step=0.01)

    def start(self, matrix):
        pass

    def _line(self, matrix, x1, x2, hue):
        raise NotImplementedError

    def refresh(self, matrix):
        matrix.scroll("up")
        matrix.scroll("right")

        hue = next(self.hue)
        for segment in range(SEGMENTS):

            self._line(