You can define a color with for example

fillcolor('green')

Then you can fill a domain with

fill(True)
#... Here draw a domain as you did before
fill(False)

You are better off drawing three triangles ...

''' turtle_triangle_up.py
use Python module turtle to draw a triangle pointing up
draw three triangles and fill with different colors
'''

import turtle as tu

tu.title("triangle up")

def triangle_up(x, y, side, color='black'):
    """
    draw an equilateral triangle of size side starting at
    coordinates x, y (lower right corner of triangle)
    color is pen/fill color
    """
    tu.up()  # pen up
    tu.goto(x, y)
    tu.down()  # pen down
    tu.color(color)
    tu.begin_fill()
    for k in range(3):
        tu.left(360/3)
        tu.forward(side)
    tu.end_fill()


# optional ...
# speeds from 1 to 10 enforce increasingly faster animation
tu.speed(speed=8)

# center is x=0, y=0
side = 250
x1 = 0
y1 = 0
triangle_up(x1, y1, side, 'red')
# use Pythagorean theorem to calculate offset
h = (side**2 - (0.5*side)**2)**0.5
w = ((0.5*side)**2 - (0.5*h)**2)**0.5
x2 = w
y2 = -h/2
triangle_up(x2, y2, side, '#00d900')  # mod-green
# now draw smaller yellow triangle
triangle_up(x1, y1, side/2, 'yellow')


# keep showing until window corner x is clicked
tu.done()
This article has been dead for over six months. Start a new discussion instead.