当前位置: 首页>>代码示例>>Python>>正文


Python turtle.fillcolor函数代码示例

本文整理汇总了Python中turtle.fillcolor函数的典型用法代码示例。如果您正苦于以下问题:Python fillcolor函数的具体用法?Python fillcolor怎么用?Python fillcolor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fillcolor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: kwadratZolty

def kwadratZolty(a):
    dlBokKw = a / 5
    turtle.colormode(255)
    turtle.fillcolor(255, 255, 0)
    turtle.begin_fill()
    kwadrOdWierz(dlBokKw)
    turtle.end_fill()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:7,代码来源:Zadanie_1.py

示例2: drawBar

def drawBar():
	turtle.penup()
	turtle.hideturtle()
	xAxis=-600
	yAxis=-200
	turtle.goto(xAxis,yAxis)
	turtle.color("green")
	turtle.fillcolor("green")
	failTurtle=turtle.Turtle()
	failTurtle.hideturtle()
	failTurtle.penup()
	failTurtle.goto(xAxis + 50,yAxis)
	failTurtle.color("red")
	failTurtle.fillcolor("red")
	drawAxis(xTurtle, False)
	drawAxis(yTurtle, True)
	yNoPassTurtle.hideturtle()
	yNoFailTurtle.hideturtle()

	for i in range(len(studentsYear)):
		studenPerYear = studentsYear[i]
		passNo=int(studenPerYear.passNum)*5
		failNo=int(studenPerYear.failNum)*5
		graphPlot(turtle,passNo,i,yNoPassTurtle,False, studenPerYear)
		graphPlot(failTurtle,failNo,i,yNoFailTurtle,True,studenPerYear)
		xAxis=xAxis+150
		turtle.goto(xAxis,yAxis)
		failTurtle.goto(xAxis+50,yAxis)
开发者ID:nijajojen,项目名称:RemindMeApp,代码行数:28,代码来源:Graph.py

示例3: draw_move

def draw_move(turtle, cell_size, offset, domino, dx, dy, move_num, step_count):
    shade = (move_num-1) * 1.0/step_count
    rgb = (0, 1-shade, shade)
    turtle.forward((domino.head.x-offset[0]) * cell_size)
    turtle.left(90)
    turtle.forward((domino.head.y-offset[1]) * cell_size)
    turtle.right(90)
    turtle.setheading(domino.degrees)
    turtle.forward(cell_size*.5)
    turtle.setheading(math.atan2(dy, dx) * 180/math.pi)
    pen = turtle.pen()
    turtle.pencolor(rgb)
    circle_pos = turtle.pos()
    turtle.width(4)
    turtle.forward(cell_size*0.05)
    turtle.down()
    turtle.forward(cell_size*0.4)
    turtle.up()
    turtle.pen(pen)
    turtle.setpos(circle_pos)
    turtle.forward(8)
    turtle.setheading(270)
    turtle.forward(8)
    turtle.left(90)
    turtle.down()
    turtle.pencolor(rgb)
    turtle.fillcolor('white')
    turtle.begin_fill()
    turtle.circle(8)
    turtle.end_fill()
    turtle.pen(pen)
    turtle.write(move_num, align='center')
    turtle.up()
开发者ID:donkirkby,项目名称:donimoes,代码行数:33,代码来源:diagram.py

示例4: Sierpinski

def Sierpinski(side, steps):
    """Draw a Sierpinski triangle fractal, recursing the given number of steps.
       Assume we're starting from a black triangle of with sides of size side*2,
       point down, with the turtle at the bottom point.
    """
    if not steps:
        return

    # Clear a white triangle in the center.
    turtle.setheading(120)
    turtle.penup()
    turtle.forward(side)

    turtle.pendown()
    turtle.fill(True)
    turtle.fillcolor("white")
    turtle.right(120)
    turtle.forward(side)
    turtle.left(120)
    turtle.forward(side)
    turtle.left(120)
    turtle.forward(side)
    turtle.fill(False)

    # For each of the black sub-triangles left, run recursively.
    Sierpinski(side/2, steps-1)
    turtle.setheading(0)
    turtle.penup()
    turtle.forward(side)
    Sierpinski(side/2, steps-1)
    turtle.setheading(240)
    turtle.penup()
    turtle.forward(side)
    Sierpinski(side/2, steps-1)
开发者ID:akkana,项目名称:scripts,代码行数:34,代码来源:turtlefrac.py

示例5: circunferencia

def circunferencia(simbolos,identificador,linea):
  p1= obtener_punto(2,identificador,simbolos)
  radio = obtener_radio(identificador,simbolos)
  x1 = obtener_x(p1,simbolos)
  y1 = obtener_y(p1,simbolos)
 
  escalar = obtener_escalar(identificador, simbolos,linea)
  relleno = obtener_color(obtener_relleno(identificador,simbolos,linea))
  borde = obtener_color(obtener_borde(identificador,simbolos,linea))  
  turtle.color(borde)
  if escalar == 0:
    escalar=1
  tx = obtener_tx(identificador, simbolos,linea)
  ty = obtener_ty(identificador, simbolos,linea)
  turtle.pensize(8)
  turtle.penup()

  
  #Trasladar circunferencia
  x1 = x1 + tx
  y1 = y1 + ty

  #turtle.setposition(x1, y1-(radio*44))
  #turtle.pendown()
  #turtle.circle(radio*44)

  #Escalar circunferencia
  turtle.penup()
  #turtle.setposition(x1, y1-(radio*44*escalar))
  turtle.setposition(x1*44, (y1*44)-(radio*44*escalar))
  turtle.pendown()
  turtle.fillcolor(relleno)
  turtle.begin_fill()
  turtle.circle(radio*44*escalar)
  turtle.end_fill()
开发者ID:joenco,项目名称:compiladorg,代码行数:35,代码来源:figuras.py

示例6: pezzo

def pezzo(color, colors = colors, unit = unit, alfa = alfa, depth = depth):
    turtle.pencolor(colors[color])
    turtle.fillcolor(color)
    turtle.begin_fill()
    for i in range(2):
        turtle.forward(unit)
        turtle.left(90)
        turtle.forward(unit)
        turtle.left(90)
    turtle.forward(unit)
    for i in range(2):
        turtle.left(alfa)
        turtle.forward(depth)
        turtle.left(alfa)
        turtle.forward(unit)
        turtle.left(90)
    turtle.backward(unit)
    turtle.left(90)
    turtle.forward(unit)
    turtle.right(90)
    for i in range(2):
        turtle.forward(unit)
        turtle.left(alfa)
        turtle.forward(depth)
        turtle.left(180-alfa)
    turtle.end_fill()
    turtle.right(90)
    turtle.forward(unit)
    turtle.left(90)
开发者ID:pennal,项目名称:USI10YearPython,代码行数:29,代码来源:lego.py

示例7: jeden

def jeden():
    turtle.fd(50)
    turtle.fillcolor(randint(0,255),randint(0,255),randint(0,255))
    turtle.begin_fill()
    kwadrat(50)
    turtle.end_fill()
    turtle.bk(50)
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:7,代码来源:Zadanie_3.py

示例8: bobMakesASun

def bobMakesASun(turtle, size, color):
    turtle.fillcolor(color)
    turtle.begin_fill()
    for iter in range(2):
        bobMakesARay(turtle,size)
        turtle.right(160)
    turtle.end_fill()
开发者ID:enterth3r4in,项目名称:Shapes-,代码行数:7,代码来源:Shapes.py

示例9: okoL

def okoL(a):
    turtle.begin_fill()
    wielokat(6, a *4, 1)
    turtle.end_fill()
    turtle.rt(180)
    turtle.fd(a * 4)
    turtle.lt(360 / 6)
    turtle.fd(a * 4)
    turtle.lt(360 / 6)
    turtle.fd(a * 4)
    turtle.lt(360 / 6)
    turtle.fd(a * 4)
    turtle.lt(360 / 6)
    turtle.colormode(255)
    turtle.fillcolor(255, 255, 255)
    turtle.fd(a)
    turtle.rt(120)
    turtle.begin_fill()
    wielokatZeSkrP(6, 2 * a, 4)
    turtle.end_fill()
    turtle.rt(60)
    turtle.fd(a / 2)
    turtle.rt(120)
    turtle.fillcolor(0, 0, 0)
    turtle.begin_fill()
    wielokatZeSkrP(6, a, 4)
    turtle.end_fill()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:27,代码来源:Zadanie_1.py

示例10: kwadrat

def kwadrat(kolor): #kwadrat
    t.fillcolor(kolor)
    t.begin_fill()
    for i in range(4):
        t.fd(B)
        t.rt(90)
    t.end_fill()
开发者ID:chinski99,项目名称:minilogia,代码行数:7,代码来源:owoc.py

示例11: random_col

def random_col():
    x=r.randint(100,250)
    y=r.randint(180,250)
    z=r.randint(200,255)
    t.pencolor(x,y,z)
    t.fillcolor(z,x,y)
    return
开发者ID:QKid1412,项目名称:python-turtle,代码行数:7,代码来源:turtle_.py

示例12: draw_tree

def draw_tree(x,y):
    startPosX = x
    startPosY = y
    turtle.setpos(x,y)
    turtle.fillcolor("green")
    turtle.begin_fill()
    for i in range(0,4):
        x -=40
        y -=80
        turtle.goto(x,y)
        coords.append(turtle.pos())
        x += 20
        turtle.goto(x,y)
    bottomCorner = turtle.pos()
    x = startPosX
    y = startPosY
    turtle.setpos(x,y)
    for i in range(0,4):
        x +=40
        y -=80
        turtle.goto(x,y)
        coords.append(turtle.pos())
        x -= 20
        turtle.goto(x,y)
    turtle.goto(bottomCorner)
    turtle.end_fill()
开发者ID:nyep,项目名称:learning-prog,代码行数:26,代码来源:turtleTree+[WIP].py

示例13: drawFins

def drawFins(size):
    
    turtle.fillcolor("red")    
    turtle.setheading(90)
    turtle.begin_fill()
    turtle.forward(0.2*size)
    turtle.left(120)
    turtle.forward(0.6*size) 
    turtle.right(120)
    turtle.forward(0.3*size) 
    turtle.right(40)
    turtle.forward(0.8*size)
    turtle.end_fill()    
    
    turtle.setheading(0)
    
    turtle.begin_fill()

    turtle.penup()
    turtle.forward(size)
    turtle.pendown()
    turtle.begin_fill()
    turtle.right(50)
    turtle.forward(0.8*size) 
    turtle.right(40)
    turtle.forward(0.3*size) 
    turtle.right(120)
    turtle.forward(0.6*size)
    turtle.end_fill()
开发者ID:rckc,项目名称:CoderDojoUWA2016,代码行数:29,代码来源:Peter+-+Space+Rocket.py

示例14: draw_rectangle

def draw_rectangle(length_float, width_float, color_str):
    """
    Asks for the length, width, and color of the rectangle and draws it
    using turtle
    
    Recieve:    The length, width and color of the triangle
    Return:     Nothing
    Algorithm:
        Use a for loop and draw a rectangle by going forward the specified
        length and making a 90 degree turn to the right and then going
        forward the width and turning 90 degrees to the right
        Then do the loop again
    """
    
    turtle.fillcolor(color_str)    
    turtle.pendown()
    turtle.begin_fill()
    
    for i in range(2):
        turtle.forward(length_float)
        turtle.right(90)
        turtle.forward(width_float)
        turtle.right(90)
        
    turtle.end_fill()
    turtle.penup()
开发者ID:vishaladu,项目名称:pythonprojects,代码行数:26,代码来源:proj06lib.py

示例15: plansza

def plansza(bok):
    bokMalKw = bok/7
    rDuzKol = bokMalKw
    rMalKol = bokMalKw/2
    numPowPlus = 1
    numPowKola = 1
    ustNaStart(bok)
    turtle.pu() ##W figurach nie ma krawędzi
    duzyKwadrat(bok)
    ustDoPlusa(bokMalKw)
    while numPowPlus <= 4:
        plus(bokMalKw, rMalKol)
        turtle.rt(90)
        turtle.fd(bokMalKw)
        numPowPlus = numPowPlus + 1
    ustDoKol(bokMalKw)
    turtle.fillcolor(250, 250, 0)
    while numPowKola <= 4:
        turtle.rt(90)
        turtle.fd(bokMalKw)
        turtle.lt(180)
        turtle.begin_fill()
        turtle.circle(rDuzKol)
        turtle.end_fill()
        turtle.lt(180)
        turtle.fd(bokMalKw * 6)
        numPowKola = numPowKola + 1
    turtle.pd()
开发者ID:ujanlabs,项目名称:miniLogia_Py,代码行数:28,代码来源:Zadanie_1.py


注:本文中的turtle.fillcolor函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。