首页 > 解决方案 > 等效于红色中的 Rebol 效果 [渐变]?

问题描述

我在 Google 上搜索,但在 Rebol 中找不到任何与此等效的红色示例: 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]
]

标签: rebolred

解决方案


Red 的 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


推荐阅读