リファレンス › Pen and Color — 71 個のコマンド


backgroundcolor

別名: screencolor bg

pen and color

入力: none
出力: number

現在の背景色を返します。

print backgroundcolor
0

backgroundshade

別名: bgs

pen and color

入力: none
出力: shade (number)

Returns the current background shade value. See setbackgroundshade

show backgroundshade

color

pen and 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

pen and color

入力: 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

pen and color

入力: 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

pen and color

入力: list of lists
出力: none

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

definecolors colors

fillcolor

別名: fc

pen and color

入力: none
出力: number

選択中のタートルが現在使用している塗りつぶし色を返します。

print myrtle:fillcolor
7

fillshade

別名: fsh

pen and color

入力: none
出力: shade (number)

Returns the current fillshade value. See setfillshade

show fillshade

fillopacity

pen and color

入力: none
出力: opacity (number)

Returns the current fill opacity

show opacity

gradient

pen and color

入力: 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

pen and color

入力: 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

pen and color

入力: none
出力: none

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

listcolors

nogradient

pen and color

入力: none
出力: none

Disables gradient. See gradient

nogradient

nolightlines

pen and color

入力: none
出力: none

Disables line lighting. See lightlines

nolightlines

nopencaps

pen and color

入力: none
出力: none

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

nopencaps

nopenjoins

pen and color

入力: none
出力: none

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

nopenjoins

pen

pen and color

入力: none
出力: word

ペンの状態、PENUP または PENDOWN を返します。

show pen
PENUP

pencaps

pen and color

入力: none
出力: none

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

pencaps

pencolor

別名: pc

pen and color

入力: none
出力: number

現在のペンの色を返します。

show pencolor

pendepth

pen and color

入力: none
出力: word

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

show pendepth

pendown

別名: pd

pen and color

入力: none
出力: none

呼び出したタートルのペンを下ろします(移動時に線を描くようになります)。

pendown

penjoins

pen and color

入力: 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

pen and color

入力: none
出力: number

Returns the calling turtles pen opacity. See setpenopacity

shoe penopacity

penshade

別名: psh

pen and color

入力: none
出力: shade (number)

Returns the current pen shade value. See setpenshade

show penshade

pensides

pen and color

入力: none
出力: 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

入力: none
出力: word

現在のペンスタイルを返します。

show penstyle

penstyles

pen and color

入力: none
出力: word

Returns the available pen styles.

show penstyles

penup

別名: pu

pen and color

入力: none
出力: none

呼び出したタートルのペンを上げます。移動しても線を描きません。pendown を参照

penup

penwidth

別名: pw

pen and color

入力: none
出力: number OR list

現在のペンの太さを返します。setpenwidth を参照

show penwidth

randombackgroundcolor

別名: randbg rbg

pen and color

入力: none
出力: none

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

repeat 50 [randbg] setbg 0

randombackgroundshade

別名: randbs rbs

pen and color

入力: none
出力: none

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

randbs

randomfillcolor

別名: randfc rfc

pen and color

入力: none
出力: none

現在の塗りつぶし色とは異なるランダムな塗りつぶし色(1 〜 15)を設定します。setfillcolor を参照

randomfillcolor sphere 10

randomfillopacity

別名: randfo

pen and color

入力: none
出力: none

Sets a random fill opacity. See setfillopacity

randomfillopacity

randomfillshade

別名: randfs rfs

pen and color

入力: none
出力: none

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

randomfillshade

randompencolor

別名: randpc rpc

pen and color

入力: none
出力: none

現在のペンの色とは異なるランダムなペンの色(1 〜 15)を設定します。setpencolor を参照

pendown repeat 10 [randvec randompencolor fd 100 home]

randompenopacity

別名: randpo

pen and color

入力: none
出力: none

Sets a random pen opacity. See setpenopacity

randompenopacity

randompenshade

別名: randps rps

pen and color

入力: none
出力: none

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

randompenshade

randompenwidth

別名: randpw

pen and color

入力: none
出力: none

Sets a random pen width value

randompenwidth

setbackgroundcolor

別名: setbg sbg

pen and color

入力: number
出力: none

背景色を、指定された番号が参照するカラーインデックスに設定します。colors プリミティブの説明で挙げられている色名も使用できます。これらは対応するインデックス番号を返す関数だからです。

setbackgroundcolor 5
setbg yellow

setfillcolor

別名: setfc sfc

pen and color

入力: color (number)
出力: none

タートルが図形を作成する際に使用する塗りつぶし色を設定します。

setfillcolor 3
setfillcolor blue

setfillshade

別名: setfs sfs

pen and color

入力: 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

pen and color

入力: opacity (number)
出力: none

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

setfillopacity 50

setlinesnormal

pen and color

入力: 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

pen and color

入力: color (number)
出力: none

ペンの色を指定されたカラーインデックスに設定します。yellow や blue のように、対応する番号を返すカラー関数が多数あり、数値の代わりに使えます。colors を参照

setpencolor yellow
setpc 13

setpendepth

別名: setpd

pen and color

入力: 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

pen and color

入力: 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

pen and color

入力: number
出力: none

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

setpenopacity 50

setpensides

pen and color

入力: 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

pen and color

入力: 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

pen and color

入力: number OR [startwidth endwidth]
出力: none

ペンの太さを設定します。太さを 1 より大きくすると、線の代わりに円柱が描かれます(OpenGL がそれ以外の線幅を非推奨としているためです)。2 つの太さのリストを与えることもでき、1 つ目が線の開始時の太さ、2 つ目が終了時の太さになります。太いペンの側面数を設定するには setpensides を参照。なお、1 つの作品の中で複数のペンサイズを使えるようになったため、clearscreen はペンの太さをリセットします。より幅の広い二次元の線については mark も参照

setpenwidth 5
setpenwidth [5 10]

snip

pen and color

入力: 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

pen and color

入力: none
出力: number

黒のカラー番号 (0) を返します。

setpencolor black

blue

pen and color

入力: none
出力: number

青のカラー番号 (2) を返します。

setpencolor blue

brown

pen and color

入力: none
出力: number

茶色のカラー番号 (8) を返します。

setpencolor brown

cyan

pen and color

入力: none
出力: number

シアンのカラー番号 (14) を返します。

setpencolor cyan

gray

pen and color

入力: none
出力: number

グレーのカラー番号 (5) を返します。grey としても使えます。

setpencolor gray

green

pen and color

入力: none
出力: number

緑のカラー番号 (4) を返します。

setpencolor green

grey

pen and color

入力: none
出力: number

グレーのカラー番号 (5) を返します。gray と同じです。

setpencolor grey

lightblue

pen and color

入力: none
出力: number

ライトブルーのカラー番号 (7) を返します。

setpencolor lightblue

lightgray

pen and color

入力: none
出力: number

ライトグレーのカラー番号 (10) を返します。lightgrey としても使えます。

setpencolor lightgray

lightgreen

pen and color

入力: none
出力: number

ライトグリーンのカラー番号 (12) を返します。

setpencolor lightgreen

lightgrey

pen and color

入力: none
出力: number

ライトグレーのカラー番号 (10) を返します。lightgray と同じです。

setpencolor lightgrey

magenta

pen and color

入力: none
出力: number

マゼンタのカラー番号 (3) を返します。

setpencolor magenta

~markerwidth

pen and color

入力: none
出力: number

Returns the current marker width setting.

print ~markerwidth

mediumblue

pen and color

入力: none
出力: number

ミディアムブルーのカラー番号 (6) を返します。

setpencolor mediumblue

orange

pen and color

入力: none
出力: number

オレンジのカラー番号 (9) を返します。

setpencolor orange

pc

pen and color

入力: none
出力: number | list

Short form of pencolor. Returns the current pen color.

print pc

pink

pen and color

入力: none
出力: number

ピンクのカラー番号 (11) を返します。

setpencolor pink

red

pen and color

入力: none
出力: number

赤のカラー番号 (1) を返します。

setpencolor red

white

pen and color

入力: none
出力: number

白のカラー番号 (15) を返します。

setpencolor white

yellow

pen and color

入力: none
出力: number

黄色のカラー番号 (13) を返します。

setpencolor yellow