Esempio n. 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")
Esempio n. 2
0
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()
Esempio n. 3
0
 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")
Esempio n. 4
0
 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)
Esempio n. 5
0
def PICS():
    PIC()
    with cf.transform(y=1.1,
                      angle=180,
                      lightness=0.2,
                      hue=-0.1,
                      saturation=-0.39):
        PICS()
Esempio n. 6
0
def dot():
    with transform(y=0.1):
        dot()
Esempio n. 7
0
def line():  # {300 * [r .1 x 2] dot {} }
    for i in range(300):
        with transform(angle=i * 0.1, x=2 * i):
            dot()
Esempio n. 8
0
def branch():
    with transform(angle=30):
        branch()
Esempio n. 9
0
def trunk():
    with transform(scale=0.5, hue=0.001):
        branch()
Esempio n. 10
0
def PICS():
    PIC()
    with cf.transform(x=1.1, hue=0.41):
        PICS()
Esempio n. 11
0
def gr():
    with transform(x=-1):
        gr()
Esempio n. 12
0
def dot():
    with transform(angle=90, hue=0.01):
        branch()
Esempio n. 13
0
def PICS():
    PIC()
    with cf.transform(x=1.1, angle=-90, hue=0.3, saturation=-0.02):
        PICS()
Esempio n. 14
0
def PICS():
    PIC()
    with cf.transform(y=1.1, hue=-0.02):
        PICS()
Esempio n. 15
0
def PICS():
    PIC()
    with cf.transform(y=1.1, angle=-90, hue=-0.19):
        PICS()
Esempio n. 16
0
def PICS():
    PIC()
    with cf.transform(y=1.1, angle=90, hue=-0.3, saturation=0.03):
        PICS()
Esempio n. 17
0
def PICS():
    PIC()
    with cf.transform(y=-1.1, hue=220):
        PICS()
Esempio n. 18
0
def dot():
    with transform(angle=90):
        trail()
    trail()
Esempio n. 19
0
def dot():
    with transform(angle=90):
        line()  # {r 90 h 0 }  }
Esempio n. 20
0
def PICS():
    PIC()
    with cf.transform(x=1.1, angle=90, hue=0.4):
        PICS()
Esempio n. 21
0
def trail():  # { 200    * [y 2 a -0.02] grain {a -.1} }
    for i in range(200):
        with transform(y=2 * i, alpha=-0.5 ** i):
            grain()
Esempio n. 22
0
 def element():
     circle(1)
     with transform(x=1, scale=0.2):
         element()
Esempio n. 23
0
def mycircle():
    circle()
    with transform(x=1, scale=0.5):
        mycircle()
Esempio n. 24
0
def PICS():
    PIC()
    with cf.transform(x=1.1, angle=180, hue=0.6, alpha=0.1):
        PICS()