Beispiel #1
0
def draw_parametric(color):
    div1 = random.randint(8, 16)
    div2 = random.randint(8, 16)
    div3 = random.randint(8, 16)
    div4 = random.randint(8, 16)
    mul1 = random.randint(100, 250)
    mul2 = random.randint(100, 250)
    mul3 = random.randint(100, 250)
    mul4 = random.randint(100, 250)

    def x(t):
        return math.sin(t / div1) * mul1 + math.sin(t / div2) * mul2

    def y(t):
        return math.cos(t / div3) * mul3 + math.cos(t / div4) * mul4

    start = random.randint(0, 9999999)
    end = random.randint(1, 2000)
    ink = shades.BlockColor(color)
    go = True

    for i in range(0, end, 1):
        if go:
            t = start + i
            ink.circle(
                canvas,
                (canvas.width / 2 + x(t / 15), canvas.height / 2 + y(t / 15)),
                1)
        if random.randint(0, 200) == 77:
            go = not go
Beispiel #2
0
def draw_parametric(color):
    div1 = random.randint(8,16)
    div2 = random.randint(8,16)
    div3 = random.randint(8,16)
    div4 = random.randint(8,16)
    mul1 = random.randint(100, 250)
    mul2 = random.randint(100, 250)
    mul3 = random.randint(100, 250)
    mul4 = random.randint(100, 250)

    def x(t):
        return math.sin(t / div1) * mul1 + math.sin(t / div2) * mul2

    def y(t):
        return math.cos(t / div3) * mul3 + math.cos(t / div4) * mul4

    start = random.randint(0,9999999)
    end = random.randint(1, 1500)
    ink = shades.BlockColor(color)

    for i in range(0, end, 2):
        t = start + i
        ink.line(canvas, (canvas.width/2 + x(t/15), canvas.height/2 + y(t/15)), (canvas.width/2 + x(t/12), canvas.height/2 + y(t/12)), 1)
Beispiel #3
0
import shades
from random import randint

canvas = shades.Canvas(1000, 1000, (220, 230, 229))
block = shades.BlockColor((229, 211, 96))
size_noise = shades.NoiseField(scale=0.02)
x_space_noise = shades.NoiseField(scale=0.02)
y_space_noise = shades.NoiseField(scale=0.002)
color_noise = shades.NoiseField(scale=0.02)
colors = [
    (189, 213, 215),
    (67, 99, 110),
    (253, 243, 218),
    (103, 151, 165),
    (255, 193, 178),
]

x = 0
y = 0
t = randint(1, 9999)
scale = randint(3, 5)
scale_change_x = randint(2, 4)
scale_change_y = randint(2, 4)

while y < canvas.height:
    x = 0
    while x < canvas.width:
        block.circle(canvas, (x, y), size_noise.noise((t, 1)) * scale)
        x += x_space_noise.noise((t, 1)) * scale * scale_change_x
        t += 1
        c_val = color_noise.noise((t, 1))
Beispiel #4
0
import shades
from random import randint

def random_point():
    x = randint(0, canvas.width)
    y = randint(0, canvas.height)
    return (x, y)

def nearby_point(point):
    x = point[0] + randint(-300, 300)
    y = point[1] + randint(-300, 300)
    return (x, y)

canvas = shades.Canvas(1000, 1000)
shade = shades.BlockColor()
gradient = shades.NoiseGradient(
    color=(200,200,200),
    color_variance=70,
)

for i in range(2):
    x_offset = randint(-50, 50)
    y_offset = randint(-50, 50)
    gradient.noise_fields = [shades.NoiseField(scale=0.002) for i in range(3)]
    points = [random_point() for i in range(500000)]
    for point in points:
        color = gradient.determine_shade(nearby_point(point))
        shade.color = color
        shade.point(canvas, (point[0] + x_offset, point[1] + y_offset))

canvas.show()
Beispiel #5
0
import shades
import random

GRID_SIZE = 40

canvas = shades.Canvas()
shadow = shades.BlockColor((40, 40, 40))
gradient = shades.NoiseGradient((200, 200, 200))

for i in range(10):
    # todo: add logic to check whether square already there
    #       add additional shapes
    x = random.choice(range(0, canvas.width, GRID_SIZE))
    y = random.choice(range(0, canvas.height, GRID_SIZE))
    width = GRID_SIZE * random.randint(1, 5)
    shadow.square(canvas, (x + 5, y + 5), width)
    gradient.square(canvas, (x, y), width)

canvas.show()
Beispiel #6
0
import shades
import random
from handy_stuff import palletes

canvas = shades.Canvas(height=2000, width=2000)
transparency = random.uniform(0.4, 0.9)
pallete = random.choice(palletes)
inks = [shades.BlockColor(i, transparency=0.6) for i in pallete]


def draw_rect_with_lines(shade, canvas, topcorner, height, width):
    offset_1 = random.randint(0, 500)
    offset_2 = random.randint(0, 500)
    if random.random() < 0.5:
        for x in range(topcorner[0], topcorner[0] + width, 5):
            shade.line(
                canvas,
                (x + offset_1, topcorner[1]),
                (x + offset_2, topcorner[1] + height),
                1,
            )
    else:
        for y in range(topcorner[1], topcorner[1] + height, 5):
            shade.line(
                canvas,
                (topcorner[0], y + offset_1),
                (topcorner[0] + width, y + offset_2),
                1,
            )

Beispiel #7
0
import shades
from random import choice, randint

canvas = shades.Canvas(800, 500, color=(249, 241, 228))
ink = shades.BlockColor()
units = 50


def pick_colour():
    colours = [
        (233, 80, 62),
        (76, 111, 190),
        (252, 218, 0),
        (0, 142, 41),
        (249, 241, 228),
        (204, 195, 175),
    ]
    var = 0
    colour = choice(colours)
    return shades.color_clamp(
        (colour[0] + randint(-var, var), colour[1] + randint(-var, var),
         colour[2] + randint(-var, var)))


def rythm(y):
    height = units * randint(1, 3)
    width = units * randint(1, 4)
    spacing = width * randint(0, 5)
    placement = spacing
    ink.color = pick_colour()

def nearby_point(point, distance):
    x = point[0] + randint(-distance, distance)
    y = point[1] + randint(-distance, distance)
    while shades.distance_between_points(point, (x, y)) > distance:
        x = point[0] + randint(-distance, distance)
        y = point[1] + randint(-distance, distance)
    return (x, y)


def blueish():
    blue = (87, 141, 209)
    blueish = [i + randint(-20, 20) for i in blue]
    return tuple(blueish)


canvas = shades.Canvas(1000, 1000)
shade = shades.BlockColor(
    color=(87, 141, 209),
    transparency=0.95,
    warp_size=20,
    warp_noise=[shades.NoiseField(scale=0.002) for i in range(2)])
center = (int(canvas.width / 2), int(canvas.height / 2))

for i in range(15):
    off_center = nearby_point(center, 100)
    shade.circle(canvas, off_center, 300)

canvas.show()
Beispiel #9
0
import shades
from handy_stuff import palletes
import random

pallete = random.choice(palletes)

canvas = shades.Canvas()
tones = []
i = 0
while i < 1:
    add_to = random.uniform(0.0001, 0.0005)
    tones.append((
        i,
        i + add_to,
        shades.BlockColor(random.choice(pallete)),
    ))
    i += add_to

swirl = shades.SwirlOfShades(
    shades=tones,
    swirl_field=shades.NoiseField(scale=0.002),
    depth=1,
)

swirl.fill(canvas)
canvas.show()
Beispiel #10
0
import shades

canvas = shades.Canvas(700, 700)

line = shades.BlockColor((240, 240, 240))
top = shades.VerticalGradient([((255, 178, 0), 300), ((240, 240, 240), 50)])
bottom = shades.VerticalGradient([((145, 161, 219), 300),
                                  ((131, 104, 151), canvas.height)])

vertical_border = canvas.height * 1 / 10
horizontal_border = canvas.width / 5

shape_height = canvas.height - (vertical_border * 2)
shape_width = canvas.width - (horizontal_border * 2)

top.rectangle(canvas, (horizontal_border, vertical_border), shape_width,
              shape_width * 2 / 3)
bottom.rectangle(canvas,
                 (horizontal_border, vertical_border + (shape_width * 2 / 3)),
                 shape_width, shape_height - shape_width * 2 / 3)

line.circle_outline(canvas,
                    (canvas.width / 2, canvas.height - vertical_border * 4),
                    shape_width / 2 * 4 / 5)

canvas.show()
Beispiel #11
0
import shades
import random
from handy_stuff import palletes

canvas = shades.Canvas(2000, 2000)
pallete = random.choice(palletes)
random.shuffle(pallete)

canvas = shades.Canvas(2000, 2000, pallete[0])

tone = shades.BlockColor(warp_noise=shades.noise_fields(
    scale=[0, random.uniform(0, 0.002)], channels=2),
                         warp_size=random.randint(300, 900))
shift = random.randint(3, 9)

for y in range(-tone.warp_size, canvas.height + tone.warp_size, 30):
    for x in range(-50, canvas.width):
        for i in range(30):
            tone.color = pallete[i % len(pallete)]
            tone.weighted_point(canvas, (x + i * shift, y + i * shift), 2)

canvas.show()
Beispiel #12
0
import shades
import random

canvas = shades.Canvas(1300, 1300)
ink = shades.BlockColor(
    warp_size=500,
    warp_noise=[shades.NoiseField(scale=0.01) for i in range(2)],
)
colors = [
    (193, 246, 218),
    (249, 220, 220),
    (242, 250, 251),
    (207, 229, 244),
    (249, 222, 238),
]


def random_point():
    x = random.randint(0, canvas.width)
    y = random.randint(0, canvas.height)
    return (x, y)


for i in range(9000):
    ink.color = random.choice(colors)
    point = random_point()
    shift = (
        point[0] + random.randint(-1000, 1000),
        point[1] + random.randint(-1000, 1000),
    )
    ink.line(canvas, point, shift, 3)
Beispiel #13
0
import shades

canvas = shades.Canvas()

black = shades.BlockColor((20, 20, 20))
red = shades.BlockColor((255, 20, 0))
blue = shades.BlockColor((0, 139, 200))

swirl = shades.SwirlOfShades(shades=[(0.25, 0.3, black), (0.3, 0.4, red),
                                     (0.4, 0.45, black), (0.55, 0.6, black),
                                     (0.6, 0.8, blue), (0.8, 0.85, red),
                                     (0.85, 0.9, black)],
                             noise_field=shades.NoiseField(scale=0.006),
                             feedback=2)

swirl.fill(canvas)

canvas.show()
Beispiel #14
0
import shades

canvas = shades.Canvas()
shade = shades.SwirlOfShades(
    noise_field=shades.NoiseField(scale=0.005),
    shades=([(0.4, 0.6, shades.BlockColor((63, 151, 197)))]),
)

shade.fill(canvas)
canvas.show()
Beispiel #15
0
import shades
import random
from handy_stuff import palletes

canvas = shades.Canvas()
if random.random() < 0.5:
    tones = [
        shades.NoiseGradient((180, 180, 180),
                             color_fields=shades.noise_fields(scale=0.002,
                                                              channels=3))
        for i in range(random.randint(2, 15))
    ]
else:
    pallete = random.choice(palletes)
    tones = [shades.BlockColor(i) for i in pallete]

shift = random.randint(10, 40)
spacing = random.randint(2, 5)
grid_size_x = random.randint(20, 30)
grid_size_y = random.randint(30, 60)

for y in range(-grid_size_y, canvas.height + grid_size_y, grid_size_y):
    for i, x in enumerate(
            range(-grid_size_x, canvas.width + grid_size_x, grid_size_x)):
        tone = random.choice(tones)
        for plus_y in range(0, grid_size_y, spacing):
            if i % 2 == 0:
                tone.line(canvas, (x, y + plus_y),
                          (x + grid_size_x, y + plus_y + shift), 1)
            else:
                tone.line(canvas, (x, y + plus_y + shift),
Beispiel #16
0
import shades

canvas = shades.Canvas()

warp_size = 50
warp = shades.BlockColor(
    warp_size=warp_size,
    warp_noise=[shades.NoiseField(scale=0.1),
                shades.NoiseField(scale=0)],
)
ink = shades.BlockColor()
noise = shades.NoiseField()

for y in range(-warp_size, canvas.height + warp_size, 10):
    for x in range(-warp_size, canvas.width + warp_size):
        size = noise.noise((x, y)) * 3
        if size > 0:
            xy = warp.adjust_point((x, y))
            ink.circle(canvas, xy, size)

canvas.show()
Beispiel #17
0
import shades

canvas = shades.Canvas(1400, 1400)

shade = shades.NoiseGradient(
    color = (200, 200, 200),
    noise_fields = [shades.NoiseField(scale=0.002) for i in range(3)],
    warp_size = 300,
    warp_noise = (shades.NoiseField(scale=0.002),shades.NoiseField(scale=0.002))
)

for x in range(-300, canvas.width+300, 10):
    shade.line(canvas, (x,-300), (x,canvas.height+300), 1)

for y in range(-300, canvas.height+300, 10):
    shade.line(canvas, (-300,y), (canvas.height+300,y), 1)

white = shades.BlockColor((240,240,240))
border_size = 300

white.rectangle(canvas, (0, 0), border_size, canvas.height)
white.rectangle(canvas, (0, 0), canvas.width, border_size)
white.rectangle(canvas, (0, canvas.height - border_size), canvas.width, border_size)
white.rectangle(canvas, (canvas.width - border_size, 0), border_size, canvas.height)

canvas.show()
Beispiel #18
0
import shades
from random import randint

canvas = shades.Canvas(1000, 1000)

shade = shades.BlockColor(
    warp_size=140,
    warp_noise=[shades.NoiseField(scale=0.003) for i in range(2)])
gradient = shades.NoiseGradient(
    color=(200, 200, 200),
    noise_fields=[shades.NoiseField(scale=0.002) for i in range(3)])


def random_point():
    x = randint(-140, canvas.width + 140)
    y = randint(-140, canvas.height + 340)
    return (x, y)


def nearby_point(point):
    x = point[0] + randint(-300, 300)
    y = point[1] + randint(-300, 300)
    return (x, y)


points = [random_point() for i in range(5000)]

for point in points:
    color = gradient.determine_shade(nearby_point(point))
    shade.color = color
    shade.line(canvas, point, (point[0], point[1] + 200), 2)
import shades

canvas = shades.Canvas()
ink = shades.BlockColor(color=(0,255, 255), transparency=0.6, warp_noise=[shades.NoiseField(0.002) for i in range(2)], warp_size=30)
ink2 = shades.BlockColor(color=(255, 0, 255), transparency=0.6, warp_noise=[shades.NoiseField(0.002) for i in range(2)], warp_size=30)
ink3 = shades.BlockColor(color=(255, 255, 0), transparency=0.6, warp_noise=[shades.NoiseField(0.002) for i in range(2)], warp_size=30)
ink4 = shades.BlockColor(color=(0,255, 255), transparency=0.6, warp_noise=[shades.NoiseField(0.002) for i in range(2)], warp_size=30)
ink5 = shades.BlockColor(color=(255, 0, 255), transparency=0.6, warp_noise=[shades.NoiseField(0.002) for i in range(2)], warp_size=30)
ink6 = shades.BlockColor(color=(255, 255, 0), transparency=0.6, warp_noise=[shades.NoiseField(0.002) for i in range(2)], warp_size=30)

for x in range(-30, canvas.width+30, 5):
    for y in range(-30, canvas.height+30, 5):
        ink.line(canvas, (x,y), (x, y+3))
        ink2.line(canvas, (x,y), (x, y+3))
        ink3.line(canvas, (x,y), (x, y+3))
        ink4.line(canvas, (x,y), (x, y+3))
        ink5.line(canvas, (x,y), (x, y+3))
        ink6.line(canvas, (x,y), (x, y+3))

canvas.show()
import shades
from random import randint
from scipy.spatial import Delaunay

canvas = shades.Canvas(700, 700)
background = shades.NoiseGradient(
    color=(0, 0, 50),
    noise_fields=[shades.NoiseField(scale=0.002) for i in range(3)])
white = shades.BlockColor((255, 255, 255))

background.fill(canvas)

points = [(randint(0, canvas.width), randint(0, canvas.height))
          for i in range(200)]

for point in points:
    white.circle(canvas, point, randint(1, 1))

# drawing triangles between points
for tri in Delaunay(points).simplices:
    if randint(1, 30) == 1:
        white.triangle_outline(canvas, points[tri[0]], points[tri[1]],
                               points[tri[2]], 1)

canvas.show()
Beispiel #21
0
import shades
from random import randint


def nearby_point(point, distance):
    x = point[0] + randint(-distance, distance)
    y = point[1] + randint(-distance, distance)
    while shades.distance_between_points(point, (x, y)) > distance:
        x = point[0] + randint(-distance, distance)
        y = point[1] + randint(-distance, distance)
    return (x, y)


canvas = shades.Canvas(4000, 4000)
background_shade = shades.BlockColor((240, 240, 240))
foreground = shades.BlockColor()
gradient = shades.NoiseGradient(
    color=(200, 200, 200),
    color_variance=70,
    noise_fields=[shades.NoiseField(scale=0.0002) for i in range(3)],
)

steps = 20
walk_distance = 50
wackiness = 300
color_distance = 1000

for i in range(15):
    foreground.noise_fields = [
        shades.NoiseField(scale=0.002) for i in range(3)
    ]
Beispiel #22
0
import shades

canvas = shades.Canvas()

shade = shades.NoiseGradient(
    color=(200, 200, 200),
    noise_fields=[shades.NoiseField(scale=0.002) for i in range(3)],
)

block = shades.BlockColor(
    color=(240, 240, 240),
    warp_size=150,
    warp_noise=(shades.NoiseField(scale=0), shades.NoiseField(scale=0.008)),
)

shade.fill(canvas)

for y in range(-150, canvas.height + 150, 4):
    block.line(canvas, (-150, y), (canvas.width + 150, y), 1)

canvas.show()
Beispiel #23
0
import shades
from random import randint


def nearby_point(point, distance):
    x = point[0] + randint(-distance, distance)
    y = point[1] + randint(-distance, distance)
    while shades.distance_between_points(point, (x, y)) > distance:
        x = point[0] + randint(-distance, distance)
        y = point[1] + randint(-distance, distance)
    return (x, y)


canvas = shades.Canvas(4000, 4000)
background_shade = shades.BlockColor((240, 240, 240))
foreground = shades.BlockColor(
    color=(41, 104, 136),
    warp_size=50,
    warp_noise=[shades.NoiseField(scale=0.02),
                shades.NoiseField(scale=0.001)],
)
steps = 25
walk_distance = 10
wackiness = 50

for i in range(1, steps):
    y = i / steps * canvas.height
    start = (0, y)
    end = (canvas.width, y)
    last_point = start
    while last_point[0] < end[0]:
Beispiel #24
0
import shades
import random

canvas = shades.Canvas(1500, 1000)
shade_one = shades.BlockColor((97, 196, 227))
shade_two = shades.BlockColor((247, 228, 91))
shade_three = shades.BlockColor((251, 5, 28))
shade_four = shades.BlockColor((23, 79, 114))


def stack(start_coords, width, height, offset):
    perc = height / 100
    shade_dict = {
        0: shade_one,
        random.randint(perc * 33, perc * 40): shade_two,
        random.randint(perc * 46, perc * 50): shade_three,
        random.randint(perc * 75, perc * 85): shade_four,
        perc * 200: shade_one,
    }
    for y in range(int(start_coords[1]), int(start_coords[1] + height), 5):
        filtered_dict = {k: shade_dict[k] for k in shade_dict if k > y}
        color = filtered_dict[list(filtered_dict.keys())[0]]
        color.line(canvas, (start_coords[0], y),
                   (start_coords[0] + width, y + offset), 2)


margin = 50
width = 20
gap = 5
tilt = random.randint(0, 20)
import shades
import random

canvas = shades.Canvas(2000, 2000, (240, 240, 240))
underlay = shades.BlockColor((230, 230, 230))
highlight = shades.BlockColor()
highlight_colors = [(244, 131, 166), (128, 199, 242), (213, 205, 209)]
highlight_weights = [1, 10, 10]
underlay = shades.BlockColor((220, 220, 220))
line = shades.BlockColor((220, 220, 220), transparency=1)

grid_size = 100
grid_points = []

for x in range(0, canvas.width, int(grid_size)):
    for y in range(0, canvas.height, int(grid_size)):
        if random.random() > 0.5:
            underlay.circle(canvas, (x, y), 3)
        else:
            underlay.line(canvas, (x - 5, y - 5), (x + 5, y + 5), 2)
            underlay.line(canvas, (x - 5, y + 5), (x + 5, y - 5), 2)


def random_point():
    x_grid_lr = int(canvas.width / grid_size / 4)
    x_grid_ur = x_grid_lr * 2
    y_grid_lr = int(canvas.height / grid_size / 4)
    y_grid_ur = y_grid_lr * 2
    x = grid_size * random.randint(x_grid_lr, x_grid_ur)
    y = grid_size * random.randint(y_grid_lr, y_grid_ur)
    return [x, y]