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")
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")
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)
def mycircle(): circle() with transform(x=1, scale=0.5): mycircle()
def test_ipython(self): init(face_color="#123456", background_color="#aaaaaa") circle(1) display_ipython()
def element(): circle(1) with transform(x=1, scale=0.2): element()