リファレンス › Pen and Color — 71 個のコマンド
backgroundcolor
別名: screencolor bg
入力: none
出力: number
現在の背景色を返します。
print backgroundcolor
0
backgroundshade
別名: bgs
入力: none
出力: shade (number)
Returns the current background shade value. See setbackgroundshade
show backgroundshade
color
入力: number
出力: 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
入力: none
出力: 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
別名: dfw
入力: index (number) | list or word
出力: 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
入力: list of lists
出力: none
Defines all 64 color palettes based on the provided list of 64 RGB (0-100) values.
definecolors colors
fillcolor
別名: fc
入力: none
出力: number
選択中のタートルが現在使用している塗りつぶし色を返します。
print myrtle:fillcolor
7
fillshade
別名: fsh
入力: none
出力: shade (number)
Returns the current fillshade value. See setfillshade
show fillshade
fillopacity
入力: none
出力: opacity (number)
Returns the current fill opacity
show opacity
gradient
入力: none
出力: 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
入力: none
出力: 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
入力: none
出力: none
Prints out the 64 (0-63) color indexes and their associated RGB values. See colors, showcolors
listcolors
nogradient
入力: none
出力: none
Disables gradient. See gradient
nogradient
nolightlines
入力: none
出力: none
Disables line lighting. See lightlines
nolightlines
nopencaps
入力: none
出力: none
Disables pencaps, which add 'caps' to the start and end of lines. See pencaps, pencapsp
nopencaps
nopenjoins
入力: none
出力: none
Disables penjoins, which create an intermediary shape that connects two consecutive line segments. See penjoins
nopenjoins
pen
入力: none
出力: word
ペンの状態、PENUP または PENDOWN を返します。
show pen
PENUP
pencaps
入力: none
出力: none
Causes starting and ending 'caps' to be added to lines. See nopencaps, pencapsp
pencaps
pencolor
別名: pc
入力: none
出力: number
現在のペンの色を返します。
show pencolor
pendepth
入力: none
出力: word
Returns the current pen depth. Currently only applicable to the 'mark' penstyle. See setpenstyle
show pendepth
pendown
別名: pd
入力: none
出力: none
呼び出したタートルのペンを下ろします(移動時に線を描くようになります)。
pendown
penjoins
入力: none
出力: 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
入力: none
出力: number
Returns the calling turtles pen opacity. See setpenopacity
shoe penopacity
penshade
別名: psh
入力: none
出力: shade (number)
Returns the current pen shade value. See setpenshade
show penshade
pensides
入力: none
出力: number
Returns the number of sides of the cylinder drawn by the pen primitives when penwidth > 1. See setpensides
show pensides
penstyle
入力: none
出力: word
現在のペンスタイルを返します。
show penstyle
penstyles
入力: none
出力: word
Returns the available pen styles.
show penstyles
penup
別名: pu
入力: none
出力: none
呼び出したタートルのペンを上げます。移動しても線を描きません。pendown を参照
penup
penwidth
別名: pw
入力: none
出力: number OR list
現在のペンの太さを返します。setpenwidth を参照
show penwidth
randombackgroundcolor
別名: randbg rbg
入力: none
出力: none
Selects a random background color (0 - 15). See setbackgroundcolor
repeat 50 [randbg] setbg 0
randombackgroundshade
別名: randbs rbs
入力: none
出力: none
Selects a random background shade (-12 to 12). See setbackgroundshade
randbs
randomfillcolor
別名: randfc rfc
入力: none
出力: none
現在の塗りつぶし色とは異なるランダムな塗りつぶし色(1 〜 15)を設定します。setfillcolor を参照
randomfillcolor sphere 10
randomfillopacity
別名: randfo
入力: none
出力: none
Sets a random fill opacity. See setfillopacity
randomfillopacity
randomfillshade
別名: randfs rfs
入力: none
出力: none
Sets a random fill shade value between -12 and 12. See setfillshade
randomfillshade
randompencolor
別名: randpc rpc
入力: none
出力: none
現在のペンの色とは異なるランダムなペンの色(1 〜 15)を設定します。setpencolor を参照
pendown repeat 10 [randvec randompencolor fd 100 home]
randompenopacity
別名: randpo
入力: none
出力: none
Sets a random pen opacity. See setpenopacity
randompenopacity
randompenshade
別名: randps rps
入力: none
出力: none
Sets a random pen shade value between -12 and 12. See setpenshade
randompenshade
randompenwidth
別名: randpw
入力: none
出力: none
Sets a random pen width value
randompenwidth
setbackgroundcolor
別名: setbg sbg
入力: number
出力: none
背景色を、指定された番号が参照するカラーインデックスに設定します。colors プリミティブの説明で挙げられている色名も使用できます。これらは対応するインデックス番号を返す関数だからです。
setbackgroundcolor 5
setbg yellow
setfillcolor
別名: setfc sfc
入力: color (number)
出力: none
タートルが図形を作成する際に使用する塗りつぶし色を設定します。
setfillcolor 3
setfillcolor blue
setfillshade
別名: setfs sfs
入力: shade (number)
出力: 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
別名: setfo
入力: opacity (number)
出力: none
Sets the fill opacity, takes a number from 0 to 100.
setfillopacity 50
setlinesnormal
入力: vector (list)
出力: 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
別名: setpc spc
入力: color (number)
出力: none
ペンの色を指定されたカラーインデックスに設定します。yellow や blue のように、対応する番号を返すカラー関数が多数あり、数値の代わりに使えます。colors を参照
setpencolor yellow
setpc 13
setpendepth
別名: setpd
入力: number
出力: 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
別名: setps sps
入力: shade (number)
出力: 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
別名: setpo spo
入力: number
出力: none
Sets the pen's opacity. Takes a number from 0 to 100.
setpenopacity 50
setpensides
入力: sides (number)
出力: 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
別名: setpst
入力: style (word)
出力: none
ペンのスタイルを設定します。現在 4 種類があります: line, mark, tube, voxel。line は細い OpenGL の線、mark は平らなリボン、tube は円柱、voxel はワールドに沿って並ぶボクセル列(Minecraft のようなもの)です。ペンの太さを 1 より大きくすると、現在の Space が 2D か 3D かに応じて line スタイルは自動的に mark または tube に変わります。penstyle を参照。また pendepth と setpendepth も参照(この 2 つは mark と voxel スタイルにのみ適用されます)
setpenstyle "mark
setpenwidth
別名: spw setpw
入力: number OR [startwidth endwidth]
出力: none
ペンの太さを設定します。太さを 1 より大きくすると、線の代わりに円柱が描かれます(OpenGL がそれ以外の線幅を非推奨としているためです)。2 つの太さのリストを与えることもでき、1 つ目が線の開始時の太さ、2 つ目が終了時の太さになります。太いペンの側面数を設定するには setpensides を参照。なお、1 つの作品の中で複数のペンサイズを使えるようになったため、clearscreen はペンの太さをリセットします。より幅の広い二次元の線については mark も参照
setpenwidth 5
setpenwidth [5 10]
snip
入力: none
出力: 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
入力: none
出力: number
黒のカラー番号 (0) を返します。
setpencolor black
blue
入力: none
出力: number
青のカラー番号 (2) を返します。
setpencolor blue
brown
入力: none
出力: number
茶色のカラー番号 (8) を返します。
setpencolor brown
cyan
入力: none
出力: number
シアンのカラー番号 (14) を返します。
setpencolor cyan
gray
入力: none
出力: number
グレーのカラー番号 (5) を返します。grey としても使えます。
setpencolor gray
green
入力: none
出力: number
緑のカラー番号 (4) を返します。
setpencolor green
grey
入力: none
出力: number
グレーのカラー番号 (5) を返します。gray と同じです。
setpencolor grey
lightblue
入力: none
出力: number
ライトブルーのカラー番号 (7) を返します。
setpencolor lightblue
lightgray
入力: none
出力: number
ライトグレーのカラー番号 (10) を返します。lightgrey としても使えます。
setpencolor lightgray
lightgreen
入力: none
出力: number
ライトグリーンのカラー番号 (12) を返します。
setpencolor lightgreen
lightgrey
入力: none
出力: number
ライトグレーのカラー番号 (10) を返します。lightgray と同じです。
setpencolor lightgrey
magenta
入力: none
出力: number
マゼンタのカラー番号 (3) を返します。
setpencolor magenta
~markerwidth
入力: none
出力: number
Returns the current marker width setting.
print ~markerwidth
mediumblue
入力: none
出力: number
ミディアムブルーのカラー番号 (6) を返します。
setpencolor mediumblue
orange
入力: none
出力: number
オレンジのカラー番号 (9) を返します。
setpencolor orange
pc
入力: none
出力: number | list
Short form of pencolor. Returns the current pen color.
print pc
pink
入力: none
出力: number
ピンクのカラー番号 (11) を返します。
setpencolor pink
red
入力: none
出力: number
赤のカラー番号 (1) を返します。
setpencolor red
white
入力: none
出力: number
白のカラー番号 (15) を返します。
setpencolor white
yellow
入力: none
出力: number
黄色のカラー番号 (13) を返します。
setpencolor yellow