A shadow object
describes a drop shadow, as the CSS property
box-shadow
does. It is the shape of a graphical, moved by
shadow<-x_offset
and shadow<-y_offset,
grown by shadow<-spread,
blurred over shadow<-blur
pixels and painted in shadow<-colour,
which normally has an alpha so the background shows through. The shadow
is painted outside the area of the graphical, which keeps its size, and
not under the graphical itself, so it also shows correctly for a
graphical without fill.
The classes box, ellipse, circle and figure have a shadow<->shadow:
send(Box, shadow, new(_, shadow)) send(Box, shadow, new(_, shadow(0, 6, 16, colour(@default, 0, 0, 0, 110))))
For compatibility, shadow->shadow also
accepts an integer N, which is a soft shadow N pixels to the bottom
right, blurred over 2N pixels in the default colour, and 0, which
removes the shadow.
A shadow with a large shadow<-blur
is drawn by blurring an image of the shape and thus takes more time to
paint than the shape itself.
.g.,
colour(@default, 0, 0, 0, 80).colour(@default, 0, 0, 0, 80)
and 0, a soft shadow below the shape.
shadow(N, N, 2*N).