Référence › Pen and Color — 71 commandes


backgroundcolor

Aussi: screencolor bg

pen and color

Entrée: none
Sortie: number

Renvoie la couleur de fond actuelle.

print backgroundcolor
0

backgroundshade

Aussi: bgs

pen and color

Entrée: none
Sortie: shade (number)

Returns the current background shade value. See setbackgroundshade

show backgroundshade

color

pen and color

Entrée: number
Sortie: list

color returns the red, green and blue values of the specified color

show color 5
[128 128 128]
show color brown
[128 80 0]

colors

pen and color

Entrée: none
Sortie: list

Returns a list of lists containing all of the colors' RGB values in order of color index, eg with the first list being [0 0 0] (black) and the 16th list being white [255 255 255]. For an easier-to-read version, see listcolors

show colors

definecolor

Aussi: dfw

pen and color

Entrée: index (number) | list or word
Sortie: none

definecolor takes an index number from 0 to 63 and either a list of three values (representing red, green, and blue) with a value from 0 to 100, or a 6-character word representing a color's RGB values in hexadecimal format, for example ab1274. The color palette defined by definecolor is used for pen and fill colors. To use definecolor to alter the colors used in a turtle model, definecolor must be used inside the turtle model definition. For text colors see definetextcolor

definecolor 20 [50 20 90]
definecolor 21 "ab1274

definecolors

pen and color

Entrée: list of lists
Sortie: none

Defines all 64 color palettes based on the provided list of 64 RGB (0-100) values.

definecolors colors

fillcolor

Aussi: fc

pen and color

Entrée: none
Sortie: number

Renvoie la couleur de remplissage utilisée actuellement par la tortue sélectionnée.

print myrtle:fillcolor
7

fillshade

Aussi: fsh

pen and color

Entrée: none
Sortie: shade (number)

Returns the current fillshade value. See setfillshade

show fillshade

fillopacity

pen and color

Entrée: none
Sortie: opacity (number)

Returns the current fill opacity

show opacity

gradient

pen and color

Entrée: none
Sortie: none

Causes lines, squares, quads, spots, polyspots, spheres, toruses, voxels, cylinders, cylinderarcs, tubes, funnels, cones and pyramids to graduate in color from the pencolor value to the fillcolor value. nogradient disables it. See gradientp

cs gradient randpc randfc repeat 36 [fd 100 rt 170]

lightlines

pen and color

Entrée: none
Sortie: none

Enables lighting for lines. Normally off by default. As lines have no 'side', their 'normal' (the direction in which light is reflected) needs to be manually set using setlinesnormal. nolightlines disables it.

lightlines

listcolors

pen and color

Entrée: none
Sortie: none

Prints out the 64 (0-63) color indexes and their associated RGB values. See colors, showcolors

listcolors

nogradient

pen and color

Entrée: none
Sortie: none

Disables gradient. See gradient

nogradient

nolightlines

pen and color

Entrée: none
Sortie: none

Disables line lighting. See lightlines

nolightlines

nopencaps

pen and color

Entrée: none
Sortie: none

Disables pencaps, which add 'caps' to the start and end of lines. See pencaps, pencapsp

nopencaps

nopenjoins

pen and color

Entrée: none
Sortie: none

Disables penjoins, which create an intermediary shape that connects two consecutive line segments. See penjoins

nopenjoins

pen

pen and color

Entrée: none
Sortie: word

Renvoie l'état du crayon, PENUP ou PENDOWN

show pen
PENUP

pencaps

pen and color

Entrée: none
Sortie: none

Causes starting and ending 'caps' to be added to lines. See nopencaps, pencapsp

pencaps

pencolor

Aussi: pc

pen and color

Entrée: none
Sortie: number

Renvoie la couleur actuelle du crayon.

show pencolor

pendepth

pen and color

Entrée: none
Sortie: word

Returns the current pen depth. Currently only applicable to the 'mark' penstyle. See setpenstyle

show pendepth

pendown

Aussi: pd

pen and color

Entrée: none
Sortie: none

Baisse le crayon de la tortue appelante : elle trace une ligne lorsqu'elle se déplace.

pendown

penjoins

pen and color

Entrée: none
Sortie: none

When enabled, causes an intermediate 'join' to be created between two line segments in pen styles that support it (currently pipe and mark) nopenjoins disables it. See setpenstyle, penjoinsp

penjoins

penopacity

pen and color

Entrée: none
Sortie: number

Returns the calling turtles pen opacity. See setpenopacity

shoe penopacity

penshade

Aussi: psh

pen and color

Entrée: none
Sortie: shade (number)

Returns the current pen shade value. See setpenshade

show penshade

pensides

pen and color

Entrée: none
Sortie: number

Returns the number of sides of the cylinder drawn by the pen primitives when penwidth > 1. See setpensides

show pensides

penstyle

pen and color

Entrée: none
Sortie: word

Renvoie le style de crayon actuel.

show penstyle

penstyles

pen and color

Entrée: none
Sortie: word

Returns the available pen styles.

show penstyles

penup

Aussi: pu

pen and color

Entrée: none
Sortie: none

Relève le crayon de la tortue appelante : elle ne trace plus de ligne en se déplaçant. Voir pendown

penup

penwidth

Aussi: pw

pen and color

Entrée: none
Sortie: number OR list

Renvoie la largeur actuelle du crayon. Voir setpenwidth

show penwidth

randombackgroundcolor

Aussi: randbg rbg

pen and color

Entrée: none
Sortie: none

Selects a random background color (0 - 15). See setbackgroundcolor

repeat 50 [randbg] setbg 0

randombackgroundshade

Aussi: randbs rbs

pen and color

Entrée: none
Sortie: none

Selects a random background shade (-12 to 12). See setbackgroundshade

randbs

randomfillcolor

Aussi: randfc rfc

pen and color

Entrée: none
Sortie: none

Choisit une couleur de remplissage au hasard (1 - 15), différente de la couleur actuelle. Voir setfillcolor

randomfillcolor sphere 10

randomfillopacity

Aussi: randfo

pen and color

Entrée: none
Sortie: none

Sets a random fill opacity. See setfillopacity

randomfillopacity

randomfillshade

Aussi: randfs rfs

pen and color

Entrée: none
Sortie: none

Sets a random fill shade value between -12 and 12. See setfillshade

randomfillshade

randompencolor

Aussi: randpc rpc

pen and color

Entrée: none
Sortie: none

Choisit une couleur de crayon au hasard (1 - 15), différente de la couleur actuelle. Voir setpencolor

pendown repeat 10 [randvec randompencolor fd 100 home]

randompenopacity

Aussi: randpo

pen and color

Entrée: none
Sortie: none

Sets a random pen opacity. See setpenopacity

randompenopacity

randompenshade

Aussi: randps rps

pen and color

Entrée: none
Sortie: none

Sets a random pen shade value between -12 and 12. See setpenshade

randompenshade

randompenwidth

Aussi: randpw

pen and color

Entrée: none
Sortie: none

Sets a random pen width value

randompenwidth

setbackgroundcolor

Aussi: setbg sbg

pen and color

Entrée: number
Sortie: none

Règle la couleur de fond sur l'indice de couleur désigné par le nombre fourni. Vous pouvez employer les noms de couleur cités dans la description de la primitive colors, car ce sont en réalité des fonctions qui renvoient l'indice correspondant.

setbackgroundcolor 5
setbg yellow

setfillcolor

Aussi: setfc sfc

pen and color

Entrée: color (number)
Sortie: none

Règle la couleur de remplissage utilisée par la tortue lorsqu'elle crée des formes.

setfillcolor 3
setfillcolor blue

setfillshade

Aussi: setfs sfs

pen and color

Entrée: shade (number)
Sortie: none

Sets the shade of the fill color to be displayed when rendering subsequent shapes. It can be set to a number from 0 to 15, which represents a decrease in brightness of the fill color of 6.25 times that number. So, a value of 8 decreases the brightness by 50%. Negative shade values add 1/16th of the difference between each of the base RGB values of the color and 255

setfillshade 5

setfillopacity

Aussi: setfo

pen and color

Entrée: opacity (number)
Sortie: none

Sets the fill opacity, takes a number from 0 to 100.

setfillopacity 50

setlinesnormal

pen and color

Entrée: vector (list)
Sortie: none

Sets the 'normal' vector to be used by lightlines. All lines use the same vector. This is easiest taken from a turtle. Remember that if you take the forwarddir from Snappy, you will need to reverse it, using vectorsub! See lightlines

setlinesnormal vectorsub snappy:forwarddir [0 0 0]

setpencolor

Aussi: setpc spc

pen and color

Entrée: color (number)
Sortie: none

Règle la couleur du crayon sur l'indice de couleur fourni. Notez qu'il existe plusieurs fonctions de couleur qui renvoient l'indice correspondant, comme yellow ou blue, et qui peuvent remplacer un nombre. Voir colors

setpencolor yellow
setpc 13

setpendepth

Aussi: setpd

pen and color

Entrée: number
Sortie: none

Sets the depth of the pen, used currently only by the mark and voxel styles. pendepth is automatically set to the value of penwidth when the voxel penstyle is selected, but can be changed afterwards. See setpenstyle, pendepth

setpendepth 5

setpenshade

Aussi: setps sps

pen and color

Entrée: shade (number)
Sortie: none

Sets the shade of the pen color to be displayed when rendering subsequent lines. It can be set to a number from 0 to 15, which represents a decrease in brightness of the pen color of 6.25 times that number. So, a value of 8 decreases the brightness by 50%.

setpenshade 5

setpenopacity

Aussi: setpo spo

pen and color

Entrée: number
Sortie: none

Sets the pen's opacity. Takes a number from 0 to 100.

setpenopacity 50

setpensides

pen and color

Entrée: sides (number)
Sortie: none

Sets the number of sides of the cylinder created by the pen primitives when the penwidth is > 1. The default is 10. See pensides

setpensides 3

setpenstyle

Aussi: setpst

pen and color

Entrée: style (word)
Sortie: none

Règle le style du crayon. Il en existe actuellement 4 : line, mark, tube et voxel. line est une fine ligne OpenGL, mark un ruban plat, tube un cylindre et voxel une suite de voxels alignés sur le monde (comme dans Minecraft). Si la largeur du crayon dépasse 1, le style line devient automatiquement mark ou tube selon que l'espace courant est en 2D ou en 3D. Voir penstyle, ainsi que pendepth et setpendepth (ces deux derniers ne concernent que les styles mark et voxel)

setpenstyle "mark

setpenwidth

Aussi: spw setpw

pen and color

Entrée: number OR [startwidth endwidth]
Sortie: none

Règle la largeur du crayon. Au-delà de 1, des cylindres sont tracés à la place des lignes (OpenGL ayant rendu obsolètes les autres largeurs de ligne). Vous pouvez aussi fournir une liste de deux largeurs : la première pour le début de la ligne, la seconde pour sa fin. Voir setpensides pour régler le nombre de côtés des crayons larges. Comme plusieurs largeurs peuvent désormais servir dans une même création, clearscreen réinitialise la largeur du crayon. Voir aussi mark (pour des lignes larges en deux dimensions)

setpenwidth 5
setpenwidth [5 10]

snip

pen and color

Entrée: none
Sortie: none

Removes the second-last point (the point before the turtle's current position) and then connects the third-last and current, creating a line between them. Used to smooth out designs that use orbit, for example.

fd 20 rt 90 fd 20 snip

black

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du noir (0).

setpencolor black

blue

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du bleu (2).

setpencolor blue

brown

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du brun (8).

setpencolor brown

cyan

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du cyan (14).

setpencolor cyan

gray

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du gris (5). Également disponible sous le nom grey.

setpencolor gray

green

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du vert (4).

setpencolor green

grey

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du gris (5). Identique à gray.

setpencolor grey

lightblue

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du bleu clair (7).

setpencolor lightblue

lightgray

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du gris clair (10). Également disponible sous le nom lightgrey.

setpencolor lightgray

lightgreen

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du vert clair (12).

setpencolor lightgreen

lightgrey

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du gris clair (10). Identique à lightgray.

setpencolor lightgrey

magenta

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du magenta (3).

setpencolor magenta

~markerwidth

pen and color

Entrée: none
Sortie: number

Returns the current marker width setting.

print ~markerwidth

mediumblue

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du bleu moyen (6).

setpencolor mediumblue

orange

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur de l'orange (9).

setpencolor orange

pc

pen and color

Entrée: none
Sortie: number | list

Short form of pencolor. Returns the current pen color.

print pc

pink

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du rose (11).

setpencolor pink

red

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du rouge (1).

setpencolor red

white

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du blanc (15).

setpencolor white

yellow

pen and color

Entrée: none
Sortie: number

Renvoie le numéro de couleur du jaune (13).

setpencolor yellow