size <- dev_size("px")
canvas("darkslateblue") |>
add_rect(
matrix(c(0, 0, size[1], size[2]), ncol = 4),
props = paint(
blend_mode = BlendMode$Lighten,
sytle = Style$Fill,
shader = Shader$conical_gradient(
c(size[1] / 2 * .8, size[2] / 2 * .8),
c(size[1] / 2 * .2, size[2] / 2 * .2),
c(size[1] / 2 * .8, size[1] / 2 * .2),
from = col2rgba("blueviolet"),
to = col2rgba("skyblue"),
mode = TileMode$Clamp,
flags = FALSE,
transform = c(1, 0, 0, 0, 1, 0, 0, 0, 1)
)
)
) |>
add_circle(
matrix(c(size[1] / 2, size[2]), ncol = 2), size[1] * .4,
props = paint(
blend_mode = BlendMode$HardLight,
style = Style$Stroke,
cap = Cap$Square,
path_effect = PathEffect$line_2d(12, c(12, 0, 0, 0, 32, 0, 0, 0, 1)),
shader = Shader$sweep_gradient(
c(size[1] / 2, size[2]),
0, 360,
from = col2rgba("magenta"),
to = col2rgba("gold"),
mode = TileMode$Clamp,
flags = FALSE,
transform = c(1, 0, 0, 0, 1, 0, 0, 0, 1)
)
)
) |>
draw_img()