等效于红色的 Rebol 效果 [渐变]?
Equivalent of Rebol effect [gradient] in Red?
我在 Google 上进行了搜索,但在 Rebol 中找不到与此等效的任何 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]
]
Red的View还不支持效果管,但是你可以在Draw中设置渐变:
view [base 100x100 draw [fill-pen linear 0.0.0 255.255.255 0x0 100x100 box 0x0 100x100]]
(我在 Linux,所以我无法测试它,但我认为它应该可以工作)。
有关详细信息,请参阅 https://doc.red-lang.org/en/draw.html#_linear_gradient_fill。
我在 Google 上进行了搜索,但在 Rebol 中找不到与此等效的任何 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]
]
Red的View还不支持效果管,但是你可以在Draw中设置渐变:
view [base 100x100 draw [fill-pen linear 0.0.0 255.255.255 0x0 100x100 box 0x0 100x100]]
(我在 Linux,所以我无法测试它,但我认为它应该可以工作)。
有关详细信息,请参阅 https://doc.red-lang.org/en/draw.html#_linear_gradient_fill。