Skip to content

Instantly share code, notes, and snippets.

@rgchris
Last active February 7, 2026 20:37
Show Gist options
  • Select an option

  • Save rgchris/be468763f0c61459abe8f8bdcfd3f882 to your computer and use it in GitHub Desktop.

Select an option

Save rgchris/be468763f0c61459abe8f8bdcfd3f882 to your computer and use it in GitHub Desktop.
SVG (animated) example
Rebol [
Title: "SVG Sample"
Needs: [
r3:rgchris:svg
]
]
print svg/encode svg/create 400x400 [
rectangle #[fill: #myGradient] 20x200 360x180
circle #[fill: none stroke: #myGradient stroke-width: 10] 160x200 100
animate linear-gradient #myGradient [
start 0x100
end 100x0
; user-space-on-use
stop 0 1 #f00
stop 50% .5 #0f0
animate stop 100% 1 #00f [
animate 'stop-opacity 5 [1 0 1]
]
][
animate 'x1 5 [0 1 1 0 0]
animate 'y1 5 [0 0 1 1 0]
animate 'x2 5 [1 0 0 1 1]
animate 'y2 5 [1 1 0 0 1]
]
]
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Notes

  • Modules installation instructions: rgchris/Scripts/r3-oldes

  • Shape and other functions that are currently supported (e.g. path, rectangle, circle, linear-gradient, radial-gradient, stop) return the tree at the point where the shape/node has been inserted, the animate function takes this as its argument.

  • The none on line 10 of animated.reb is a WORD! of value none, not a NONE! value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment