rebol - 等效于红色中的 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]
]
解决方案
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。
推荐阅读
- javascript - 在 HTML 画布上加载图像时处理 Image.onerror 中的 404
- regex - sed:打印匹配
- angular - @Input 数组未定义
- angular - 动态排序但变量名未定义
- c++ - TOCTTOU - 在处理文件之前使用访问权限
- python - python 3的rsplit中的错误是什么?
- ms-wopi - 证明密钥验证总是失败
- dependency-injection - ASP.Net Core 2.2 Scoped Service 值更新
- c++ - 带有 AUTOMOC 的 CMake 正在删除我的实现
- java - JavaFX:加载文件后布局更改