Fill
Describes how a fill is filled with color or media.
If both media
and color
are defined, media
takes precedence.
Properties
mediaContainer
object
Read-onlyA media fill, if any.
set
function
Parameters
state
undefined | MediaFillState
A state that creates an image fill.
type
string
Read-onlyThe type of media.
This must be "image"
.
imageRef
ImageRef
Read-onlyA unique identifier that points to an image asset in Canva's backend.
flipX
boolean
If true
, the image is flipped horizontally.
flipY
boolean
If true
, the image is flipped vertically.
A state that creates a video fill.
type
string
Read-onlyThe type of media.
This must be "video"
.
videoRef
VideoRef
Read-onlyA unique identifier that points to a video asset in Canva's backend.
flipX
boolean
If true
, the video is flipped horizontally.
flipY
boolean
If true
, the video is flipped vertically.
Returns
void
ref
undefined | MediaFill
An image that fills the interior of a media.
type
string
Read-onlyThe type of media.
This must be "image"
.
imageRef
ImageRef
Read-onlyA unique identifier that points to an image asset in Canva's backend.
flipX
boolean
If true
, the image is flipped horizontally.
flipY
boolean
If true
, the image is flipped vertically.
A video that fills the interior of a media.
type
string
Read-onlyThe type of media.
This must be "video"
.
videoRef
VideoRef
Read-onlyA unique identifier that points to a video asset in Canva's backend.
flipX
boolean
If true
, the video is flipped horizontally.
flipY
boolean
If true
, the video is flipped vertically.
colorContainer
object
Read-onlyA color fill, if any.
set
function
Parameters
state
undefined | SolidFillState
type
string
Read-onlyThe type of color.
This must be "solid"
.
color
string
The color of the fill.
This must be a valid, six-digit hex code, prefixed with a #
symbol.
- Must be six characters long.
- Must start with a
#
. - Must use lowercase letters.
Example
"#ff0099"
Returns
void
ref
undefined | ColorFill
A solid color that fills an interior.
type
string
Read-onlyThe type of color.
This must be "solid"
.
color
string
The color of the fill.
This must be a valid, six-digit hex code, prefixed with a #
symbol.
- Must be six characters long.
- Must start with a
#
. - Must use lowercase letters.
Example
"#ff0099"
Represents something that's not supported by the Apps SDK.
type
string
Read-onlyThis must be "unsupported"
.