예제 #1
0
    def test_color(self):
        init(face_color="#123456", background_color="#aaaaaa")
        circle(0.5)
        with transform(x=1, alpha=1, hue=10):
            circle(0.5)
        with transform(x=1, y=1, scale=0.6, alpha=-0.3, hue=0):
            circle(0.5)
        with transform(x=-1,
                       y=1,
                       scale=0.6,
                       alpha=0.7,
                       hue=10,
                       saturation=-1,
                       lightness=1):
            circle(0.5)
        with transform(x=-1,
                       y=-1,
                       scale=0.6,
                       alpha=0.7,
                       hue=-10,
                       saturation=-1,
                       lightness=-1):
            circle(0.5)

        write_to_png("/tmp/color.png")
예제 #2
0
 def test_main(self):
     init(face_color="#123456", background_color="#aaaaaa")
     circle(1)
     a = get_npimage()
     print(a.shape)
     report()
     write_to_png("/tmp/test.png")
예제 #3
0
 def test_rnd(self):
     init(face_color="#123456", background_color="#aaaaaa")
     circle(1)
     res = rnd(1)
     self.assertLess(res, 1.01)
     res = prnd(1)
     self.assertLess(res, 1.01)
     random.seed(5)
     res = coinflip(2)
     self.assertIn(res, [True, False])
     res = coinflip(1)
     self.assertEqual(res, False)
예제 #4
0
def mycircle():
    circle()
    with transform(x=1, scale=0.5):
        mycircle()
예제 #5
0
 def test_ipython(self):
     init(face_color="#123456", background_color="#aaaaaa")
     circle(1)
     display_ipython()
예제 #6
0
 def element():
     circle(1)
     with transform(x=1, scale=0.2):
         element()