def test_rotate(self): init() with transform(angle=0.1): box(0.5) write_to_png("/tmp/rotate.png") a = get_npimage() self.assertIsInstance(a, np.ndarray)
def test_loop(self): init(background_color="#000000", face_color="#880000") with transform(x=1.2, saturation=0.1, lightness=-0.2, hue=10) as t: for i in range(12): box() t() write_to_png("/tmp/loop.png")
def PIC(): with cf.transform(lightness=1, hue=45, saturation=0.99, alpha=-0.5): cf.box() with cf.transform(x=1.1, lightness=1, hue=55, saturation=0.99, alpha=-0.6): cf.box() with cf.transform(y=1.1, lightness=1, hue=40, saturation=1, alpha=-0.6): cf.box() with cf.transform(x=1.1, y=1.1, lightness=1, hue=50, saturation=0.9, alpha=-0.7): cf.box()
def gr(): box()
def test_flip(self): init() with flip_y(): box(0.5) a = get_npimage(y_origin="bottom") self.assertIsInstance(a, np.ndarray)