Creative Coding 習作 2024/5/26 - 図形
code:ruby
def setup
createCanvas(600, 600)
background(208, 170, 208)
end
def draw
stroke(246, 173, 113)
strokeWeight(10)
fill(113, 70, 132)
ellipse(width/2, height/2, 320, 320)
draw_line
draw_triangle
draw_rect
end
def draw_line
stroke(140, 173, 113)
strokeWeight(50)
line(600, 0, width/2, height/2)
end
def draw_triangle
fill(232, 67, 147)
stroke(246, 173, 113)
strokeWeight(2)
triangle(100, 100, 300, 300, 100, 300)
end
def draw_rect
fill(250, 177, 160)
stroke(246, 173, 113)
strokeWeight(2)
rect(20, 500, 560, 50, 10)
end
https://scrapbox.io/files/665289a3e40e5e001cb55ec5.png