Shadows

Add shadows and reflections around an object.

Shadow

class creator_studio_doc_format.core.Shadow(*, preset_identifier='', contactShadow=None, curvedShadow=None, dropShadow=None, none=None, **extra_data)[source]

The kind of shadow cast by an object, or none for no shadow.

field contactShadow : ContactShadow | None = None

A contact shadow, cast by a light directly above the object.

field curvedShadow : CurvedShadow | None = None

A curved shadow, cast as though the object were curled.

field dropShadow : DropShadow | None = None

A drop shadow, cast from above the plane of the document.

field none : Literal[True] | None = None

No shadow. This case is accepted when reading but isn’t written; the shadow property is omitted instead.

ContactShadow

class creator_studio_doc_format.core.ContactShadow(*, preset_identifier='', opacity=1, color=None, offset=0, radius=28, height=0.17364818, **extra_data)[source]

A shadow whose silhouette pools under the object’s bottom edge as though the object were standing on a ground plane.

The shadow is anchored to that edge, and height controls how far it’s foreshortened.

field opacity : float = 1

The opacity of the cast shadow, in the range 0 to 1.

Constraints:
  • ge = 0

  • le = 1

field color : Color | None = None

The color of the cast shadow. If absent, the shadow is black.

field offset : float = 0

The vertical distance, in points, between the bottom edge of the object and the point at which the imaginary ground plane is positioned. Positive values move the shadow farther down, and negative values move it up behind the object.

Constraints:
  • ge = -75

  • le = 75

field radius : float = 28

The radius (size) of the cast shadow’s blur, in the range 10 to 100.

Constraints:
  • ge = 10

  • le = 100

field height : float = 0.17364818

The apparent height of the cast shadow, given as the sine of the viewing angle between the imaginary ground plane and the eye, in the range sin(5°) to sin(35°); it controls how much the contact shadow is foreshortened. The default is sin(10°).

Constraints:
  • ge = 0.08715574

  • le = 0.57357644

CurvedShadow

class creator_studio_doc_format.core.CurvedShadow(*, preset_identifier='', angle=270, opacity=1, color=None, offset=1, radius=0, curve=1, **extra_data)[source]

A shadow whose silhouette curls away from the object, as if it were a page lifting off the surface rather than lying flat.

field angle : float = 270

The angle at which the shadow is offset from its default position, directly below the object. It’s in degrees, in the range 0 to 360, measured counterclockwise with 0 corresponding to horizontal left-to-right.

Constraints:
  • ge = 0

  • le = 360

field opacity : float = 1

The opacity of the cast shadow, in the range 0 to 1.

Constraints:
  • ge = 0

  • le = 1

field color : Color | None = None

The color of the cast shadow. If absent, the shadow is black.

field offset : float = 1

The amount by which the shadow is offset from its default position, in the direction of angle, in the range -50 to 50.

Constraints:
  • ge = -50

  • le = 50

field radius : float = 0

The radius (size) of the cast shadow’s blur, in the range 0 to 100.

Constraints:
  • ge = 0

  • le = 100

field curve : float = 1

The amount by which the shadow curls away from the object, in the range -1 to 1. When curve is 0, the shadow is cast as though the object were lying flat. Negative values of curve make the cast shadow appear as though the object were concave, with the left and right edges bulging toward the viewer; positive values make the cast shadow appear as though the object were convex, with the vertical center axis bulging toward the viewer.

Constraints:
  • ge = -1

  • le = 1

DropShadow

class creator_studio_doc_format.core.DropShadow(*, preset_identifier='', angle=270, opacity=1, color=None, offset=2, radius=5, **extra_data)[source]

A shadow whose silhouette appears as though cast by a light source facing down toward the plane of the object.

The silhouette is blurred by radius and displaced offset points in the direction given by angle. It’s the simplest of the three shadow kinds.

field angle : float = 270

The angle at which the shadow is offset from its default position, directly below the object. It’s in degrees, in the range 0 to 360, measured counterclockwise with 0 corresponding to horizontal left-to-right.

Constraints:
  • ge = 0

  • le = 360

field opacity : float = 1

The opacity of the cast shadow, in the range 0 to 1.

Constraints:
  • ge = 0

  • le = 1

field color : Color | None = None

The color of the cast shadow. If absent, the shadow is black.

field offset : float = 2

The distance, in points, by which the shadow is offset from its default position, in the direction of angle, in the range 0 to 50.

Constraints:
  • ge = 0

  • le = 50

field radius : float = 5

The radius (size) of the cast shadow’s blur, in the range 0 to 100.

Constraints:
  • ge = 0

  • le = 100

Reflection

class creator_studio_doc_format.core.Reflection(*, preset_identifier='', opacity=1, fade_acceleration=1, **extra_data)[source]

A mirrored copy of the object that the reader drew directly below it on a ground plane aligned to the horizontal axis, fading out with distance.

It extends down 40% of the object’s height, at most 120 points.

field opacity : float = 1

The reflection’s opacity where it meets the object, in the range 0 to 1 (0 is invisible). The reflection fades away from this opacity to zero as it extends farther down, at a rate set by fade_acceleration.

Constraints:
  • ge = 0

  • le = 1

field fade_acceleration : float = 1

An exponent, 1 or greater, that sets how quickly the reflection fades from opacity to clear. A value of 1 fades linearly to 40% of the object’s height (at most 120 points) when measured from the apparent ground plane, and larger values fade out more quickly.

Constraints:
  • ge = 1