# Path: opc/hue.py
# @mwt(timeout=20)
# @timefunc
# def hsvToRgb(h, s=1.0, v=1.0, rainbow=True):
#     """
#     Convert a (h, s, v) value to the (r, g, b) color space. By default,
#     we use a more cpu-intense method to curve the hue ramps above the
#     typical linear, with a view to evening out the visible range of yellow,
#     cyan, and purple.
# 
#     This method takes h, s, and v values in range 0..1 and returns r, g,
#     and b values in range 0..255.
#     """
#     if rainbow:
#         return [sin(c*pi/2)*255 for c in colorsys.hsv_to_rgb(h, s, v)]
# 
#     return [c*255 for c in colorsys.hsv_to_rgb(h, s, v)]


from opc.hue import hsvToRgb
import math
import random
import numpy
        plus_y = (y + 1) % height
        lifes = self.lifes
        return [
                    lifes[minus_x, minus_y],
                    lifes[x, minus_y],
                    lifes[plus_x, minus_y],
                    lifes[minus_x, y],
                    lifes[plus_x, y],
                    lifes[minus_x, plus_y],
                    lifes[x, plus_y],
                    lifes[plus_x, plus_y],
                ].count(True)

    def refresh(self, matrix):
        self.hue += 0.01

        matrix.shift(dh=0.9, dv=0.8)

        width = matrix.width
        height = matrix.height

        lifes = self.lifes
        next = numpy.empty([width, height])
        pixelset = {_: [] for _ in range(4)}

        for y in range(height):
            for x in range(width):
                neighbors = self._neighbors(x, y, width, height)
                if lifes[x, y]:
                    if neighbors == 2 or neighbors == 3:

# Path: opc/hue.py
# @mwt(timeout=20)
# @timefunc
# def hsvToRgb(h, s=1.0, v=1.0, rainbow=True):
#     """
#     Convert a (h, s, v) value to the (r, g, b) color space. By default,
#     we use a more cpu-intense method to curve the hue ramps above the
#     typical linear, with a view to evening out the visible range of yellow,
#     cyan, and purple.
# 
#     This method takes h, s, and v values in range 0..1 and returns r, g,
#     and b values in range 0..255.
#     """
#     if rainbow:
#         return [sin(c*pi/2)*255 for c in colorsys.hsv_to_rgb(h, s, v)]
# 
#     return [c*255 for c in colorsys.hsv_to_rgb(h, s, v)]


# Path: art/life.py
from opc.hue import hsvToRgb
import math
import random
import numpy

        plus_y = (y + 1) % height
        lifes = self.lifes
        return [
                    lifes[minus_x, minus_y],
                    lifes[x, minus_y],
                    lifes[plus_x, minus_y],
                    lifes[minus_x, y],
                    lifes[plus_x, y],
                    lifes[minus_x, plus_y],
                    lifes[x, plus_y],
                    lifes[plus_x, plus_y],
                ].count(True)

    def refresh(self, matrix):
        self.hue += 0.01

        matrix.shift(dh=0.9, dv=0.8)

        width = matrix.width
        height = matrix.height

        lifes = self.lifes
        next = numpy.empty([width, height])
        pixelset = {_: [] for _ in range(4)}

        for y in range(height):
            for x in range(width):
                neighbors = self._neighbors(x, y, width, height)
                if lifes[x, y]:
                    if neighbors == 2 or neighbors == 3:

                        cell = neighbors