Documentation / @ripl/core / CONTEXT_OPERATIONS
Variable: CONTEXT_OPERATIONS ​
constCONTEXT_OPERATIONS:object
Defined in: packages/core/src/core/constants.ts:36
Maps element state properties to their corresponding context setter functions.
Every property assigns except opacity, which composites multiplicatively: an element's own alpha stacks under whatever its ancestor groups already accumulated rather than replacing it, matching how the DOM composites nested opacity. Note this is the operation's contract, not Context.opacity's — assigning that property still replaces.
Type Declaration ​
direction ​
direction: (
context,value) =>void
Directionality used when rendering text.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<Direction | undefined> |
Returns ​
void
fill ​
fill: (
context,value) =>void
Fill style (CSS color, gradient, or pattern) used to paint filled regions.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | string |
Returns ​
void
filter ​
filter: (
context,value) =>void
CSS filter string applied to subsequent drawing operations (e.g. blur(4px)).
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | string |
Returns ​
void
font ​
font: (
context,value) =>void
CSS font shorthand used when rendering text.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | string |
Returns ​
void
fontKerning ​
fontKerning: (
context,value) =>void
Whether font kerning is applied when rendering text.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<FontKerning | undefined> |
Returns ​
void
globalCompositeOperation ​
globalCompositeOperation: (
context,value) =>void
Compositing operation controlling how new drawing is blended with existing content.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | { } |
Returns ​
void
lineCap ​
lineCap: (
context,value) =>void
Cap style drawn at the endpoints of stroked lines.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<LineCap | undefined> |
Returns ​
void
lineDash ​
lineDash: (
context,value) =>void
Dash pattern as alternating stroke and gap lengths; empty for a solid line.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number[] |
Returns ​
void
lineDashOffset ​
lineDashOffset: (
context,value) =>void
Distance into the line dash pattern at which dashing begins.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
lineJoin ​
lineJoin: (
context,value) =>void
Join style drawn where two stroked segments meet.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<LineJoin | undefined> |
Returns ​
void
lineWidth ​
lineWidth: (
context,value) =>void
Width, in pixels, of stroked lines.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
miterLimit ​
miterLimit: (
context,value) =>void
Miter length limit ratio applied to miter line joins.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
opacity ​
opacity: (
context,value) =>void
Global alpha applied to everything drawn, from 0 to 1.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
rotation ​
rotation: (
context,value) =>void
Rotation applied to the element's transform, as radians or a deg/rad string.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<Rotation | undefined> |
Returns ​
void
shadowBlur ​
shadowBlur: (
context,value) =>void
Gaussian blur radius applied to drawn shadows.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
shadowColor ​
shadowColor: (
context,value) =>void
Color of drawn shadows.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | string |
Returns ​
void
shadowOffsetX ​
shadowOffsetX: (
context,value) =>void
Horizontal offset, in pixels, of drawn shadows.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
shadowOffsetY ​
shadowOffsetY: (
context,value) =>void
Vertical offset, in pixels, of drawn shadows.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
stroke ​
stroke: (
context,value) =>void
Stroke style (CSS color, gradient, or pattern) used to paint outlines.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | string |
Returns ​
void
textAlign ​
textAlign: (
context,value) =>void
Horizontal alignment of text relative to the drawing position.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<TextAlignment | undefined> |
Returns ​
void
textBaseline ​
textBaseline: (
context,value) =>void
Vertical baseline used when positioning text.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<TextBaseline | undefined> |
Returns ​
void
transformOriginX ​
transformOriginX: (
context,value) =>void
Horizontal origin about which rotation and scaling are applied.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<TransformOrigin | undefined> |
Returns ​
void
transformOriginY ​
transformOriginY: (
context,value) =>void
Vertical origin about which rotation and scaling are applied.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | NonNullable<TransformOrigin | undefined> |
Returns ​
void
transformScaleX ​
transformScaleX: (
context,value) =>void
Horizontal scale factor applied to the element's transform.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
transformScaleY ​
transformScaleY: (
context,value) =>void
Vertical scale factor applied to the element's transform.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
translateX ​
translateX: (
context,value) =>void
Horizontal translation, in pixels, applied to the element's transform.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
translateY ​
translateY: (
context,value) =>void
Vertical translation, in pixels, applied to the element's transform.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void
zIndex ​
zIndex: (
context,value) =>void
Stacking order used to sort elements during rendering; higher values draw on top.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
value | number |
Returns ​
void