def test_color():
 x = Color('white')
 assert_array_equal(x.rgba, ([1.0] * 4))
 assert_array_equal(x.rgb, ([1.0] * 3))
 assert_array_equal(x.RGBA, ([255] * 4))
 assert_array_equal(x.RGB, ([255] * 3))
 assert_equal(x.value, 1.0)
 assert_equal(x.alpha, 1.0)
 x.rgb = [0, 0, 1]
 assert_array_equal(x.hsv, [240, 1, 1])
 assert_equal(x.hex, '#0000ff')
 x.hex = '#00000000'
 assert_array_equal(x.rgba, ([0.0] * 4))

def test_color ( ) : x = Color ( 'white' ) assert_array_equal ( x . rgba , ( [ 1.0 ] * 4 ) ) assert_array_equal ( x . rgb , ( [ 1.0 ] * 3 ) ) assert_array_equal ( x . RGBA , ( [ 255 ] * 4 ) ) assert_array_equal ( x . RGB , ( [ 255 ] * 3 ) ) assert_equal ( x . value , 1.0 ) assert_equal ( x . alpha , 1.0 ) x . rgb = [ 0 , 0 , 1 ] assert_array_equal ( x . hsv , [ 240 , 1 , 1 ] ) assert_equal ( x . hex , '#0000ff' ) x . hex = '#00000000' assert_array_equal ( x . rgba , ( [ 0.0 ] * 4 ) )
basic tests for color class .