hi guys,

i was wondering if anyone knew how to make a color wheel in python using turtle. i'v searched all over the web to see examples but haven't had any luck. i am a beginner programmer and it's very confusing to say the least so any explanations would be great! It is a bonus problem for my first programming class and i could sure use the help.

here are the directions given:
http://prntscr.com/kuqa0
http://prntscr.com/kuqaq

and this i what it should look like:
http://prntscr.com/kuqbq

From the things i did find out how to do are the commands that would come in useful to use but i dont know how to effectively use them to create the colorwheel.
Such as,
turtle.circle
turtle.color
turtle.exitonclick
turtle.begin_fill
turtle.end_fill
turtle.hideturtle
turtle.home
turtle.pendown
turtle.penup
turtle.setpos
turtle.speed
turtle.width

thanks!

Post your code if you get stuck, do not forget any error messages and explanation how you tried to solve the problem you stuck with. Also make sure that all parts are fully tested before you add code one small bit at a time, so you know that bug is in the last addition.

Just experiment with this example ...

'''turtle_circle1.py
explore Python's turtle graphic circles

turtle.circle(radius, extent=None, steps=None)
turtle.color('red') --> set pen color and fill color

'''

import turtle as tu

tu.title('turtle circles and semi-circles')

# set turtle speed, default = 'normal'
# pick from ['fastest', 'fast', 'normal', 'slow', 'slowest']
tu.speed('fastest')

# optional ...
# turtle by default starts at (x=0, y=0) center of (~450x550) window
# to pick another center lift the pen up then move
# to the right x units and up y units or ...
# to the left -x units and down -y units
# now drop the pen down to start drawing
tu.up()
# move pen to x,y
tu.goto(0,-150)
tu.down()

# default pen width is 1
tu.width(2)

# draw a solid blue circle
tu.color('blue')
tu.begin_fill()
tu.circle(200)
tu.end_fill()

# adust center of semi circles
tu.up()
tu.goto(0,-100)
tu.down()

# extent=180 degrees implies a semi circle counter-clockwise from start
# draw a solid red semicircle
tu.color('red')
tu.begin_fill()
tu.circle(150, 180)
tu.end_fill()

# followed by a solid yellow semi circle
# beware of where the turtle points to
tu.color('yellow')
tu.begin_fill()
tu.circle(150, 180)
tu.end_fill()

# adust center of white circle
tu.up()
tu.goto(0,-50)
tu.down()

# draw a solid white circle
tu.color('white')
tu.begin_fill()
tu.circle(100)
tu.end_fill()

tu.done()

Display --> http://prntscr.com/kzmq9

Edited 4 Years Ago by vegaseat

This article has been dead for over six months. Start a new discussion instead.