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
nonefor 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.
-
field contactShadow : ContactShadow | None =
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
heightcontrols how far it’s foreshortened.-
field opacity : float =
1¶ The opacity of the cast shadow, in the range
0to1.- Constraints:
ge = 0
le = 1
-
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
10to100.- 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
-
field opacity : float =
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
0to360, measured counterclockwise with0corresponding to horizontal left-to-right.- Constraints:
ge = 0
le = 360
-
field opacity : float =
1¶ The opacity of the cast shadow, in the range
0to1.- Constraints:
ge = 0
le = 1
-
field offset : float =
1¶ The amount by which the shadow is offset from its default position, in the direction of
angle, in the range-50to50.- Constraints:
ge = -50
le = 50
-
field radius : float =
0¶ The radius (size) of the cast shadow’s blur, in the range
0to100.- Constraints:
ge = 0
le = 100
-
field curve : float =
1¶ The amount by which the shadow curls away from the object, in the range
-1to1. Whencurveis0, the shadow is cast as though the object were lying flat. Negative values ofcurvemake 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
-
field angle : float =
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
radiusand displacedoffsetpoints in the direction given byangle. 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
0to360, measured counterclockwise with0corresponding to horizontal left-to-right.- Constraints:
ge = 0
le = 360
-
field opacity : float =
1¶ The opacity of the cast shadow, in the range
0to1.- Constraints:
ge = 0
le = 1
-
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 range0to50.- Constraints:
ge = 0
le = 50
-
field radius : float =
5¶ The radius (size) of the cast shadow’s blur, in the range
0to100.- Constraints:
ge = 0
le = 100
-
field angle : float =
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
0to1(0is invisible). The reflection fades away from this opacity to zero as it extends farther down, at a rate set byfade_acceleration.- Constraints:
ge = 0
le = 1
-
field fade_acceleration : float =
1¶ An exponent,
1or greater, that sets how quickly the reflection fades fromopacityto clear. A value of1fades 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
-
field opacity : float =