Stylo Doodles

Sun and Hills

Details

Author:

Alex Carney

Github:

alcarney

Dimensions:

1920 x 1080

Stylo Version:

0.6.0
Show Source Show Notes Show Both

Source

from stylo.shape import Circle
from stylo.color import FillColor
from stylo.image import LayeredImage
from stylo.domain import SquareDomain
from stylo.domain.transform import translate
hillgreen = FillColor("00ee00")
darkhillgreen = FillColor("00cc00")
lighthillgreen = FillColor("00ff00")
white = FillColor("ffffff")
sunlight = FillColor("ffff00")
hill1 = Circle(x=0, y=0, r=8, fill=True) >> translate(5, -7)
hill2 = Circle(x=0, y=0, r=8, fill=True) >> translate(-6, -6)
hill3 = Circle(x=0, y=0, r=10, fill=True) >> translate(-2, -12)
def make_cloud(x, y, scale=1):
    cloud = Circle(x=(x + 0), y=(y + 0.4), r=(0.75*scale), fill=True)
    cloud |= Circle(x=(x + 0.6), y=(y + 0.25), r=(0.6*scale), fill=True)
    cloud |= Circle(x=(x + -0.6), y=(y + 0.25), r=(0.6*scale), fill=True)
    cloud |= Circle(x=(x + -1.2), y=(y + -0.4), r=(0.65*scale), fill=True)
    cloud |= Circle(x=(x + 1.2), y=(y + -0.4), r=(0.65*scale), fill=True)
    cloud |= Circle(x=(x + 0), y=(y + -0.3), r=(0.8*scale), fill=True)
    
    return cloud
cloud1 = make_cloud(7, 4, 1) 
cloud2 = make_cloud(3, 3, 1) 
cloud3 = make_cloud(-5.5, 4.5, 1)
cloud4 = make_cloud(-9.5, 5, 1)
sun = Circle(x=-8, y=5, r=2.2, fill=True)
image = LayeredImage(background="aaeeff", scale=12)

image.add_layer(hill2, darkhillgreen)
image.add_layer(hill1, hillgreen)
image.add_layer(hill3, lighthillgreen)

image.add_layer(sun, sunlight)

image.add_layer(cloud1, white)
image.add_layer(cloud2, white)
image.add_layer(cloud3, white)
image.add_layer(cloud4, white)