Spis poleceń › Pen and Color — poleceń: 71
backgroundcolor
Także: screencolor bg
Wejście: none
Wyjście: number
Zwraca bieżący kolor tła.
print backgroundcolor
0
backgroundshade
Także: bgs
Wejście: none
Wyjście: shade (number)
Returns the current background shade value. See setbackgroundshade
show backgroundshade
color
Wejście: number
Wyjście: 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
Wejście: none
Wyjście: 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
Także: dfw
Wejście: index (number) | list or word
Wyjście: 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
Wejście: list of lists
Wyjście: none
Defines all 64 color palettes based on the provided list of 64 RGB (0-100) values.
definecolors colors
fillcolor
Także: fc
Wejście: none
Wyjście: number
Zwraca kolor wypełnienia używany obecnie przez wybranego żółwia.
print myrtle:fillcolor
7
fillshade
Także: fsh
Wejście: none
Wyjście: shade (number)
Returns the current fillshade value. See setfillshade
show fillshade
fillopacity
Wejście: none
Wyjście: opacity (number)
Returns the current fill opacity
show opacity
gradient
Wejście: none
Wyjście: 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
Wejście: none
Wyjście: 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
Wejście: none
Wyjście: none
Prints out the 64 (0-63) color indexes and their associated RGB values. See colors, showcolors
listcolors
nogradient
Wejście: none
Wyjście: none
Disables gradient. See gradient
nogradient
nolightlines
Wejście: none
Wyjście: none
Disables line lighting. See lightlines
nolightlines
nopencaps
Wejście: none
Wyjście: none
Disables pencaps, which add 'caps' to the start and end of lines. See pencaps, pencapsp
nopencaps
nopenjoins
Wejście: none
Wyjście: none
Disables penjoins, which create an intermediary shape that connects two consecutive line segments. See penjoins
nopenjoins
pen
Wejście: none
Wyjście: word
Zwraca stan pisaka, PENUP albo PENDOWN
show pen
PENUP
pencaps
Wejście: none
Wyjście: none
Causes starting and ending 'caps' to be added to lines. See nopencaps, pencapsp
pencaps
pencolor
Także: pc
Wejście: none
Wyjście: number
Zwraca bieżący kolor pisaka.
show pencolor
pendepth
Wejście: none
Wyjście: word
Returns the current pen depth. Currently only applicable to the 'mark' penstyle. See setpenstyle
show pendepth
pendown
Także: pd
Wejście: none
Wyjście: none
Opuszcza pisak wywołującego żółwia, dzięki czemu rysuje on linię podczas ruchu.
pendown
penjoins
Wejście: none
Wyjście: 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
Wejście: none
Wyjście: number
Returns the calling turtles pen opacity. See setpenopacity
shoe penopacity
penshade
Także: psh
Wejście: none
Wyjście: shade (number)
Returns the current pen shade value. See setpenshade
show penshade
pensides
Wejście: none
Wyjście: number
Returns the number of sides of the cylinder drawn by the pen primitives when penwidth > 1. See setpensides
show pensides
penstyle
Wejście: none
Wyjście: word
Zwraca bieżący styl pisaka.
show penstyle
penstyles
Wejście: none
Wyjście: word
Returns the available pen styles.
show penstyles
penup
Także: pu
Wejście: none
Wyjście: none
Podnosi pisak wywołującego żółwia; podczas ruchu nie będzie rysował linii. Zobacz pendown
penup
penwidth
Także: pw
Wejście: none
Wyjście: number OR list
Zwraca bieżącą szerokość pisaka. Zobacz setpenwidth
show penwidth
randombackgroundcolor
Także: randbg rbg
Wejście: none
Wyjście: none
Selects a random background color (0 - 15). See setbackgroundcolor
repeat 50 [randbg] setbg 0
randombackgroundshade
Także: randbs rbs
Wejście: none
Wyjście: none
Selects a random background shade (-12 to 12). See setbackgroundshade
randbs
randomfillcolor
Także: randfc rfc
Wejście: none
Wyjście: none
Ustawia losowy kolor wypełnienia (1 - 15) inny niż bieżący. Zobacz setfillcolor
randomfillcolor sphere 10
randomfillopacity
Także: randfo
Wejście: none
Wyjście: none
Sets a random fill opacity. See setfillopacity
randomfillopacity
randomfillshade
Także: randfs rfs
Wejście: none
Wyjście: none
Sets a random fill shade value between -12 and 12. See setfillshade
randomfillshade
randompencolor
Także: randpc rpc
Wejście: none
Wyjście: none
Ustawia losowy kolor pisaka (1 - 15) inny niż bieżący. Zobacz setpencolor
pendown repeat 10 [randvec randompencolor fd 100 home]
randompenopacity
Także: randpo
Wejście: none
Wyjście: none
Sets a random pen opacity. See setpenopacity
randompenopacity
randompenshade
Także: randps rps
Wejście: none
Wyjście: none
Sets a random pen shade value between -12 and 12. See setpenshade
randompenshade
randompenwidth
Także: randpw
Wejście: none
Wyjście: none
Sets a random pen width value
randompenwidth
setbackgroundcolor
Także: setbg sbg
Wejście: number
Wyjście: none
Ustawia kolor tła na indeks koloru wskazany podaną liczbą. Można używać nazw kolorów wymienionych w opisie prymitywu colors, ponieważ są to w istocie funkcje zwracające odpowiadający im numer indeksu.
setbackgroundcolor 5
setbg yellow
setfillcolor
Także: setfc sfc
Wejście: color (number)
Wyjście: none
Ustawia kolor wypełnienia, którego żółw używa przy tworzeniu kształtów.
setfillcolor 3
setfillcolor blue
setfillshade
Także: setfs sfs
Wejście: shade (number)
Wyjście: 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
Także: setfo
Wejście: opacity (number)
Wyjście: none
Sets the fill opacity, takes a number from 0 to 100.
setfillopacity 50
setlinesnormal
Wejście: vector (list)
Wyjście: 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
Także: setpc spc
Wejście: color (number)
Wyjście: none
Ustawia kolor pisaka na podany indeks koloru. Istnieje wiele funkcji kolorów zwracających odpowiadające im numery, na przykład yellow i blue, których można użyć zamiast liczby. Zobacz colors
setpencolor yellow
setpc 13
setpendepth
Także: setpd
Wejście: number
Wyjście: 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
Także: setps sps
Wejście: shade (number)
Wyjście: 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
Także: setpo spo
Wejście: number
Wyjście: none
Sets the pen's opacity. Takes a number from 0 to 100.
setpenopacity 50
setpensides
Wejście: sides (number)
Wyjście: 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
Także: setpst
Wejście: style (word)
Wyjście: none
Ustawia styl pisaka. Obecnie są 4 style: line, mark, tube i voxel. line to cienka linia OpenGL, mark to płaska wstęga, tube to walec, a voxel to ciąg wokseli wyrównanych do świata (jak w Minecrafcie). Jeśli szerokość pisaka przekroczy 1, styl line zmienia się automatycznie na mark albo tube, zależnie od tego, czy bieżąca przestrzeń jest 2D czy 3D. Zobacz penstyle, a także pendepth i setpendepth (te dwa dotyczą wyłącznie stylów mark i voxel)
setpenstyle "mark
setpenwidth
Także: spw setpw
Wejście: number OR [startwidth endwidth]
Wyjście: none
Ustawia szerokość pisaka. Jeśli szerokość przekracza 1, zamiast linii rysowane są walce (OpenGL wycofał obsługę innych szerokości linii). Można też podać listę dwóch szerokości: pierwsza to szerokość początku linii, druga jej końca. Aby ustawić liczbę boków grubszych pisaków, zobacz setpensides. Ponieważ w jednej pracy można teraz używać wielu szerokości pisaka, clearscreen przywraca szerokość domyślną. Zobacz też mark (dla szerszych, dwuwymiarowych linii)
setpenwidth 5
setpenwidth [5 10]
snip
Wejście: none
Wyjście: 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
Wejście: none
Wyjście: number
Zwraca numer koloru czarnego (0).
setpencolor black
blue
Wejście: none
Wyjście: number
Zwraca numer koloru niebieskiego (2).
setpencolor blue
brown
Wejście: none
Wyjście: number
Zwraca numer koloru brązowego (8).
setpencolor brown
cyan
Wejście: none
Wyjście: number
Zwraca numer koloru cyjan (14).
setpencolor cyan
gray
Wejście: none
Wyjście: number
Zwraca numer koloru szarego (5). Dostępne także jako grey.
setpencolor gray
green
Wejście: none
Wyjście: number
Zwraca numer koloru zielonego (4).
setpencolor green
grey
Wejście: none
Wyjście: number
Zwraca numer koloru szarego (5). To samo co gray.
setpencolor grey
lightblue
Wejście: none
Wyjście: number
Zwraca numer koloru jasnoniebieskiego (7).
setpencolor lightblue
lightgray
Wejście: none
Wyjście: number
Zwraca numer koloru jasnoszarego (10). Dostępne także jako lightgrey.
setpencolor lightgray
lightgreen
Wejście: none
Wyjście: number
Zwraca numer koloru jasnozielonego (12).
setpencolor lightgreen
lightgrey
Wejście: none
Wyjście: number
Zwraca numer koloru jasnoszarego (10). To samo co lightgray.
setpencolor lightgrey
magenta
Wejście: none
Wyjście: number
Zwraca numer koloru magenta (3).
setpencolor magenta
~markerwidth
Wejście: none
Wyjście: number
Returns the current marker width setting.
print ~markerwidth
mediumblue
Wejście: none
Wyjście: number
Zwraca numer koloru średnioniebieskiego (6).
setpencolor mediumblue
orange
Wejście: none
Wyjście: number
Zwraca numer koloru pomarańczowego (9).
setpencolor orange
pc
Wejście: none
Wyjście: number | list
Short form of pencolor. Returns the current pen color.
print pc
pink
Wejście: none
Wyjście: number
Zwraca numer koloru różowego (11).
setpencolor pink
red
Wejście: none
Wyjście: number
Zwraca numer koloru czerwonego (1).
setpencolor red
white
Wejście: none
Wyjście: number
Zwraca numer koloru białego (15).
setpencolor white
yellow
Wejście: none
Wyjście: number
Zwraca numer koloru żółtego (13).
setpencolor yellow