shadow

fun SwingModifier.shadow(radius: Int, color: Color, offsetX: Int = 0, offsetY: Int = 0): SwingModifier

Casts a blurred shadow of everything inside it, into outsets the component grows by.

The shadow is the content's own silhouette, not a declared outline: everything declared after it, tinted, blurred and laid down behind it. Rounded corners, a cut-out, a line of text - whatever the content's edge is, the shadow has it.

The outsets the blur needs are this step's outsets. A Foundation container grows the component's bounds by them while its layout bounds stay; any other parent clips what is painted past the bounds. paintOutsets(PaintOutsets.None) gives them layout space under either. See "Bounds" in docs/FOUNDATION.md.

Return

this chain with the shadow declared on it.

Parameters

radius

how far the silhouette is spread, in the component's own units; 0 or less casts a hard edge.

color

the shadow's fill, usually translucent.

offsetX

how far the shadow moves right of what casts it.

offsetY

how far the shadow moves below what casts it.