在Rebol / Red中绘制颜色

时间:2017-10-01 09:47:51

标签: draw rebol

在以下代码中来自:http://business-programming.com/business_programming.html,我想添加一个按钮来转换以蓝色而不是白色绘制的线条。我试图在各个地方添加color: blue,但它不起作用:

drawing

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]
    ]

如何使线条以蓝色而不是白色绘制?

1 个答案:

答案 0 :(得分:1)

修改

] effect [draw [line]]

] effect [draw [pen blue line]]

请参阅REBOL 2: View Draw Dialect