Rebol/Red 中的彩色绘图
Drawing in color in Rebol/Red
在来自 http://business-programming.com/business_programming.html 的以下代码中,我想添加一个按钮来转换以蓝色而不是白色绘制的线条。我尝试在不同的地方添加 color: blue
但它不起作用:
view center-face layout [
; color: blue ; does not work.
s: area black 650x350 feel [
engage: func [f a e] [
; color: blue ; does not work here also.
if a = 'over [
append s/effect/draw e/offset
show s
]
if a = 'up [append s/effect/draw 'line] ; tried adding "'pen 'blue" here before 'line
]
] effect [draw [line]]
b: btn "Save" [
save/png %a.png to-image s
alert "Saved 'a.png'"
]
btn "Clear" [
s/effect/draw: copy [line]
show s]
]
如何让线条以蓝色而不是白色绘制?
修改
] effect [draw [line]]
至
] effect [draw [pen blue line]]
在来自 http://business-programming.com/business_programming.html 的以下代码中,我想添加一个按钮来转换以蓝色而不是白色绘制的线条。我尝试在不同的地方添加 color: blue
但它不起作用:
view center-face layout [
; color: blue ; does not work.
s: area black 650x350 feel [
engage: func [f a e] [
; color: blue ; does not work here also.
if a = 'over [
append s/effect/draw e/offset
show s
]
if a = 'up [append s/effect/draw 'line] ; tried adding "'pen 'blue" here before 'line
]
] effect [draw [line]]
b: btn "Save" [
save/png %a.png to-image s
alert "Saved 'a.png'"
]
btn "Clear" [
s/effect/draw: copy [line]
show s]
]
如何让线条以蓝色而不是白色绘制?
修改
] effect [draw [line]]
至
] effect [draw [pen blue line]]