Skip to main content

get-ctx

get-ctx() 

An advanced element that allows you to read the current canvas context through a callback and return elements based on it.

// Print the transformation matrix
get-ctx(ctx => {
content((), [#repr(ctx.transform)])
})

callback:

A function that accepts the context dictionary and can return elements.