Stroke

Set a stroke before drawing a shape.

drawBot.stroke(r=None, g=None, b=None, alpha=1)

Sets the stroke color with a red, green, blue and alpha value. Each argument must a value float between 0 and 1.

# set the fill to none
fill(None)
stroke(1, 0, 0, .3)
# draw a rect
rect(10, 10, 10, 100)

# only set a gray value
stroke(0)
# draw a rect
rect(30, 10, 10, 100)

# only set a gray value with an alpha
stroke(0, .5)
# draw a rect
rect(50, 10, 10, 100)

# set rgb with no alpha
stroke(1, 0, 0)
# draw a rect
rect(70, 10, 10, 100)

# set rgb with an alpha value
stroke(1, 0, 0, .5)
# draw a rect
rect(90, 10, 10, 100)