Set point color
Set color value
setpoint color
(setpoint color opacity)
setpointat position color
(setpointat position color opacity)
setpointxy x y color
(setpointxy x y color opacity)
Blend point with color
putpoint color
(putpoint color opacity)
putpointat position color
(putpointat position color opacity)
putpointxy x y color
(putpointxy x y color opacity)
Sets point color at the current position of a turtle (setpoint
),
or at the position specified with the 2-element list or array of coordinates (setpointat
),
or at the position specified with x i y coordinates (setpointxy
).
Color can be specified as a name, index in the current palette of colors or a list or array of
color compunds: {r g b}
or {r g b opacity}
. The range of compoud values is from 0
(off) to 100 (full brightness), opacity values are from 0 (transparent) to 100 (opaque).
Instructions putpoint..
are merging the point color with
the new color values.
Example 1:
ht
repeat 1e6 [
"p := array random 70 random 70
"c := pointat :p
if :c,4 < 5 ["c := random 1000]
(setpointat :p :c 80)
]
Output: a drawing in the graphics window.
Example 2:
ht
repeat 1e5 [
"b := array (rnorm -30 20) rnorm 20
"g := array (rnorm 30 20) rnorm 20
"r := array rnorm 20 (rnorm 40 20)
putpointat :b {20 0 100 30}
putpointat :g {0 100 20 30}
putpointat :r {100 20 0 30}
]
Output: a drawing in the graphics window.
See also:
Table of Content