Пример #1
0
def rainbow(node):
    '''Colour using only changes in hue.

    It will go from 0 to 0.8 which is red, orange, yellow, green, cyan, blue,
    then purple.

    See http://en.wikipedia.org/wiki/Hue for more information on hue.
    '''
    return Color.hsv(node.time.fraction * 0.8, 0.4, 0.9)
Пример #2
0
def rainbow(node):
    """Colour using only changes in hue.

    It will go from 0 to 0.8 which is red, orange, yellow, green, cyan, blue,
    then purple.

    See http://en.wikipedia.org/wiki/Hue for more information on hue.
    """
    return Color.hsv(node.time.fraction * 0.8, 0.4, 0.9)
Пример #3
0
def test_hsv():
    c = Color.hsv(0.1, 0.5, 0.75, 0.25)
    assert c.r == 0.75
    assert abs(c.g - 0.6) < 0.1  # Floating point comparison inaccurate
    assert abs(c.b - 0.375) < 0.1
    assert c.a == 0.25
Пример #4
0
def rand(node):
    return Color.hsv(
        random.random(),
        node.calls.fraction * 0.5 + 0.5,
        node.calls.fraction * 0.5 + 0.5,
    )
Пример #5
0
def greyscale(node):
    '''Goes from dark grey to a light grey.'''
    return Color.hsv(0, 0, node.time.fraction / 2 + 0.4)
Пример #6
0
def rand(node):
    return Color.hsv(
        random.random(),
        node.calls.fraction * 0.5 + 0.5,
        node.calls.fraction * 0.5 + 0.5,
    )
Пример #7
0
def greyscale(node):
    """Goes from dark grey to a light grey."""
    return Color.hsv(0, 0, node.time.fraction / 2 + 0.4)
Пример #8
0
 def greyscale(node):
     return Color.hsv(0, 0, node.time.fraction / 2 + 0.4)
Пример #9
0
 def rainbow(node):
     return Color.hsv(node.time.fraction * 0.8, 0.4, 0.9)