我在Google上搜索但在Red中找不到与Red相当的任何示例: http://www.rebol.com/view/demos/gradient.r
view layout [
style box box 64x64
across backdrop 0.50.0
vh1 "Gradient Examples"
below guide
box effect [gradient]
box yellow effect [gradient]
box effect [gradient 200.0.0]
box yellow effect [gradient 200.0.0]
box effect [gradient 200.0.0 0.0.200]
return
box effect [gradient 1x0]
box yellow effect [gradient 1x0]
box effect [gradient 1x0 200.0.0]
box yellow effect [gradient 1x0 200.0.0]
box effect [gradient 1x0 200.0.0 0.0.200]
return
box effect [gradient -1x0]
box yellow effect [gradient -1x0]
box effect [gradient -1x0 200.0.0]
box yellow effect [gradient -1x0 200.0.0]
box effect [gradient -1x0 200.0.0 0.0.200]
return
box effect [gradient 0x1]
box yellow effect [gradient 0x1]
box effect [gradient 0x1 200.0.0]
box yellow effect [gradient 0x1 200.0.0]
box effect [gradient 0x1 200.0.0 0.0.200]
return
box effect [gradient 0x-1]
box yellow effect [gradient 0x-1]
box effect [gradient 0x-1 200.0.0]
box yellow effect [gradient 0x-1 200.0.0]
box effect [gradient 0x-1 200.0.0 0.0.200]
return
box effect [gradient 1x1]
box yellow effect [gradient 1x1]
box effect [gradient 1x1 200.0.0]
box yellow effect [gradient 1x1 200.0.0]
box effect [gradient 1x1 200.0.0 0.0.200]
return
box effect [gradient -1x1]
box yellow effect [gradient -1x1]
box effect [gradient -1x1 200.0.0]
box yellow effect [gradient -1x1 200.0.0]
box effect [gradient -1x1 200.0.0 0.0.200]
return
box effect [gradient 1x-1]
box yellow effect [gradient 1x-1]
box effect [gradient 1x-1 200.0.0]
box yellow effect [gradient 1x-1 200.0.0]
box effect [gradient 1x-1 200.0.0 0.0.200]
return
box effect [gradient -1x-1]
box yellow effect [gradient -1x-1]
box effect [gradient -1x-1 200.0.0]
box yellow effect [gradient -1x-1 200.0.0]
box effect [gradient -1x-1 200.0.0 0.0.200]
]
答案 0 :(得分:3)
Red's View还不支持效果管,但是您可以在Draw中设置渐变:
view [base 100x100 draw [fill-pen linear 0.0.0 255.255.255 0x0 100x100 box 0x0 100x100]]
(我在Linux上,因此无法对其进行测试,但它应该可以在IMO上工作。)
有关更多信息,请参见https://doc.red-lang.org/en/draw.html#_linear_gradient_fill。