1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] How to make out line color different from fill color in turtle

Discussão em 'Python' iniciado por Stack, Setembro 14, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to make my "outline color" different from my "fill color" in turtle but any time I add the second argument to color(), which is suppose to be my "fill color", everything just turns black. If I take out the second color, it uses the first color as both the "outline color" and the "fill color":

    import turtle

    china=turtle.Turtle()

    china.color('blue','green')

    china.begin_fill()

    china.forward(50)
    china.left(45)
    china.forward(50)
    china.left(45)
    china.forward(50)
    china.left(45)
    china.forward(50)
    china.left(45)
    china.forward(50)
    china.left(45)
    china.forward(50)
    china.left(45)
    china.forward(50)
    china.left(45)
    china.forward(50)
    china.end_fill()

    turtle.done()


    The code above gives me a totally black "outline color" and "fill color" why? Why not a blue "outline color" and green "fill color"?

    Continue reading...

Compartilhe esta Página